[FREE / RELEASED] Get File Info / Head REQUEST

Hi! A lot of users seem to look for a way to get file info. Here’s a plugin for that

Plugin will: generate a Head Request to url and give back informations about a file.
Content-Type
Content-Length (in bytes)
Last-Modified

There’s one element that can be used to get file info or you can use action “Get file info”. Be aware that using element may lead to CORS issue. So better to use Action that will not have this issue.

Demo here: Draweb - Plugins

Feel free to send any question if you need support!

9 Likes

Quite handy, thanks!

1 Like

Can’t return image width and height?

Does the job :+1:

1 Like

Hey @Jici

Thx for the plugin.

I’m having trouble getting the results from a list of files of different formats like videos are not being parsed, tried with .mov, .3gp.
Images like jpeg, png are ok. CSV file is ok.


Plugin setup:


So my question would be what file types / formats the plugin can parse?

Regards,

Can you share link to video files? (you can send a PM) thanks

Hey there.

Thanks for your reply. Unfortunately, can not share the links to these files, but here’s the site where I got all sample file types to test the plugin - https://file-examples.com/ which you can use and test out the plugin.

Also by looking at the console.logs I see the CORS issues mentioned on the plugin page, though I wanted to ask if it’s possible to resolve the issue with the CORS as it may seem to impact the parsing for these file types.
Thanks.

So to add to the list above, I’m getting issues with the following types of files:

  • .3gp
  • .mov
  • .json
  • .svg

Like the plugin said, a cors issue can happen if you are using element. Change to use the server side action to avoid this.
file-examples.com is not a good… example! Because the link is not a direct link to the file.
The direct link for https://file-examples.com/wp-content/storage/2018/04/file_example_AVI_480_750kB.avi
is https://file-examples.com/storage/fe42d5335b663a39f9c45ee/2018/04/file_example_AVI_480_750kB.avi Did test and you get the content-length (742478).
Without the file url you are using, I cannot do more test. This is possible that the file storage service you are using doesn’t return content-length header. There’s nothing we can do about that and the issue is from the file storage provider. Returning content-length header is highly recommended but not mandatory.

Thanks for your response.

The storage is Bubble’s internal File Storage. The sample files used for testing were downloaded from that resource and uploaded via File Uploader in Bubble app.
The CORS issue comes using the Bubble File Storage and not the external one.

As I wrote, it is related to specific types of files. Other files are fine.

If using the element is not an option, then indeed it’s sad to hear that nothing can be done.

I can confirm the issue with the element. But you can use the action to get this info.
CORS error are a security feature from browser. There’s not a lot we can do to avoid them. However, I will try to contact Bubble support about that because it’s sound strange that this error is returned only for specific file extensions.

@Jici Can you please post or send me the list of all the content types and how they show up based on what the file format/file type extension is?

Example:
audio/mp4
application/x-xfig
application/x-zip-compressed
application/vnd.openxmlformats-officedocument.presentationml.presentation
application/vnd.openxmlformats-officedocument.spreadsheetml.sheet
application/vnd.openxmlformats-officedocument.wordprocessingml.document
application/pdf
application/vnd.ms-excel
application/octet-stream
video/x-matroska
video/mp4
application/octet-stream
text/plain
image/png
image/svg+xml
image/avif
image/jpeg

There’s a lot of possible file format.
https://www.iana.org/assignments/media-types/media-types.xhtml

@Jici
Thanks, all those names and template names in those columns… is that what your plugin and bubble.io is using in the “Type” column in the file manager?

This is not my plugin anymore but yes, it should probably return similar value.