#jr-file

1 messages ยท Page 1 of 1 (latest)

haughty veldt
#

Hello! Can you share your code?

supple patrol
supple patrol
haughty veldt
#

๐Ÿ‘ let me take a look

supple patrol
haughty veldt
#

When you log front and back what do you get?

supple patrol
haughty veldt
#

Like I want you to confirm that front and back are actually what you expect them to be and have all the file data

supple patrol
supple patrol
haughty veldt
#

Im still looking, but what debugging have you done on your end so far?

#

When you log front.data.length what do you get?

#

and what express middleware are you using for handling file uploads?

supple patrol
supple patrol
haughty veldt
#

I was hoping that front.data.length was giving 0 since that would've explained why you're seeing this, but now I"m not super sure

#

and you're sure that what you're uploading is an jpg image and not something else, right?

supple patrol
vapid plinth
#

Hello! I'm taking over and catching up...

#

Just because the filename has a .jpg extension doesn't mean the data in the file is actual JPEG data. Do you have this running on a Linux server?

#

If so, can you take the data you're getting on the server, dump it into a file, and then run file <filename> on it to determine the type of data in the file?

supple patrol
vapid plinth
#

Can you try to determine what the data in the file is using one of the approaches above?

supple patrol
vapid plinth
#

Yep, I understand that. What I'm saying is can you dump that data into a file and then determine what type of data is in there using one of the approaches I described above?

supple patrol
viral dragon
#

๐Ÿ‘‹ Taking over this thread, catching up now

viral dragon
#

This is indeed strange. Can you try uploading another image?

#

Just want to check whether it is a file issue

supple patrol
viral dragon
#

So that we can double check if it's due to corrupted data or something

supple patrol
#

Like this ?

#

Yes, if I do that it will work and I don't get any error.

viral dragon
#

That's a good news

#

Then we can narrow down that the file data passing from frontend to backend is likely to be corrupted

supple patrol
viral dragon
#

So the next step is find out how to read the data correctly from the frontend

#

I'm not too familiar with Flutter. Can you find out the difference between the data from frontend and the one reading directly from backend?

#

Then you can find similar function call in Flutter and pass the information to your backend

supple patrol
viral dragon
#

When you print fp object, what does it show?

supple patrol
#

But when I get the data from the front end the buffer looks like this

viral dragon
#

Thanks for sharing. It looks like the buffer from frontend is empty

#

I'm not familiar with Flutter, so can't advice how to read the image buffer correctly in Flutter

#

I'd recommend searching online and ensure that the data pass from the frontend and the one reading directly in backend are the same

supple patrol