Accessing the File Size of a stored image

Hi all,

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.

@Bubble @eve

Thanks in advance
Reece

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.

1 Like

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?

1 Like

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?

Hi there, it’s not really a bug, just a limitation, but happy to submit

@bhavika.kaneria I’ve just submitted a bug report - would appreciate a fast solution please :slight_smile:

1 Like

Hey @help, were you ever able to find a solution for this? What did Bubble support say?

They’ve said they are adding to their feature requests, so not ideal. No solution thus far

1 Like

that’s…disappointing

Indeed. It’s blocking a critical part of my app as well but nothing I can do.

1 Like

Same. Might have to go the JS route in the meantime.

If you find a solution please do let me know

1 Like

I hope this will help :wink:

2 Likes

Amazing release thank you! Will set this up over the weekend. Appreciate it !

1 Like

Hey guys

There is a way to get the file size.
When you upload an image or file, retrieve also the file size and save into database
image

2 Likes