Extract File Size

Hello,

Does anyone know how to extract file size?

I have a multiuploader which uploads files on a field of a data type and a repeatinggroup that shows the list of files, but I cannot show the file size on rg nor upload it to a field with the multiuploader, just with a one-file uploader…

1 Like

Hi,
If you are uploading the file details to database table then, add new field called “file_size”.
On saving workflow save file size like below,
image

Hi,
Yes, I managed to do that with the fileuploader (single file), but not with the multiuploader (multiple files). Do you know if it’s possible with the multiuploader? Cause it can be annoying for users to upload one file each time.

Which plugin are you using for multiuploader?

If you are using “” plugin then,
just add

<style>
 .dropzone .dz-preview .dz-size{display:inline-block !important;}
</style>

to html element, file size will be displayed under filename.
For your reference:

Hi,
Yes, it shows the size on the multiuploader, but I still cannot add the file size to a data type. Do you know if there’s a way to do that on the multiuploader?
Thanks!

Add javascript into html element. and add new input with decimal type.
Get each filesize value by javascript like
$(‘div.dz-size’).each(function(){
//add your code
});
and calculate the total size and update into input field.
hope this works.

Hi,
I skipped this feature on the past days, cause I really don’t know how to use this javascript code… lol. Can you clarify the //add your code? I’d be very thankful! Cheers

You probably already know this but the regular file uploader allows you to access the file size. If knowing and storing the file size is the most important aspect to uploading the files, I have personally decided to skip the use of the multifile uploader and instead use single uploaders.

1 Like

Hi,

I had the same issue and found a plugin from Zeroqode that helped me solve it. Here’s the link: Head Request / Get File Info Plugin for Bubble | Zeroqode

Here’s how I implemented it in my workflow:

Front-end Workflow:
When the multi-uploader value changes, I schedule a backend workflow on a list and pass the multi-uploader value as a list of files.

Back-end Workflow:
In the backend workflow, call the plugin action “Get File Info,” and add “https:” to the parameter.

In the next step, you can retrieve the result value:

Hope this helps!