You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I would like to know how to get the file size of the image selected in a Flutter web app. I've seen some of the examples online on how to do it, and while most didn't work (they were most likely not build for the web), and when I found one that worked, it worked in a weird way. This is how it went:
Select a file, pic1, and try to upload it. As per the code, the file size is 0, so the file is "uploaded," albeit with a file size of zero.
Select another file, pic2 , and try to upload it. The file uploads, but everything's a mess: the filename says pic2, but the image uploaded is that of pic1, with pic1's correct file size at that.
If I select another file, pic3, and perform the upload, the file is uploaded as pic3, but again, the actual image is that of pic2, along with it's proper file size.
This has been bugging me for the past 36 hours or so, and I'm thinking, if I can get the actual file size on the first try, then the issue will be resolved.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Hi!
I would like to know how to get the file size of the image selected in a Flutter web app. I've seen some of the examples online on how to do it, and while most didn't work (they were most likely not build for the web), and when I found one that worked, it worked in a weird way. This is how it went:
This has been bugging me for the past 36 hours or so, and I'm thinking, if I can get the actual file size on the first try, then the issue will be resolved.
For reference, here's my code:
`
Thank you for your insights on this matter.
=====
Edit:
After looking into this a bit deeper, I've managed to get the info I needed, and then some.
Beta Was this translation helpful? Give feedback.
All reactions