It seems there’s no simple bubble dynamic data option to get the file size of an image/file.
The file size is clearly there as it can be viewed in the File Manager of the Editor, but there is no way to reference a stored image in the database and retrieve it’s file size. Lots of other options, but no size:
Any idea on the best way to get this from a stored value?
It’s available when uploading a file to a pictureUploader element, but not from a stored file.
From what I know it’s not available for Bubble storage.
Workaround
Sadly, Bubble API Connector doesn’t actually have a “head” request type. So you can use a GET request to the file url (set the type to text to avoid downloading the file again) and activate header. You will have the information about the file size in content-length header (in bytes). However, if the file is large, it may not work. I’ve never tested this.
Appreciate the suggestion @Jici - seems like a tricky workaround for something that should be really simple but ill give it a go for sure, @Bubble please can you make this easier for everyone?
Hey there! We would be more than happy to take a closer look at this - is it possible to submit a bug report to provide our bug investigations team with some additional context?