Forum Documentation Showcase Pricing Learn more

File upload limited to file type

Is there any way the file upload can be limited to file type.
I only want pdf docs to be uploaded. Is this possible?


Not right now, but if it’s critical reach out by email and we’ll see what we can do.

any update on that?
I am interested also to limit the uploading of files over 1MB or so…

Many thanks

The limitation is 50 mb/ file. This topic is about file TYPE :slight_smile:

Good to know thanks!
However, I would need also to limit that size… to downsize the storage required to save all user-files… any tip?

considering a recent video player called video.js has shown up it would be appreciated if the ability to limit file types in the uploader would be very helpful.

where are you seeing the video.js player?

it’s a plugin, you can install it from the plugin’s tab. I’d be happy if bubble’s file uploaded allowed the limiting of file types that can be uploaded so apps using plugins that rely on specific file types can be sure that the only file types they want uploaded can be uploaded.

Any solutions found for this? Just like a couple of people on this thread I need to limit uploads to PDF and also limit upload sizes.

It does seem odd that MIME Type is not exposed for File objects, since clearly Bubble knows them … as can be seen in the uploaded files section of the Data admin interface.

This actually would be super helpful. Now that there’s more robust File API functionality, perhaps this will soon be exposed.

(If MIME Type were exposed, the way this would work in one’s workflow iis: the uploader would upload whatever file the user selects, but then if that new File’s MIME Type does not match your permitted types, it would immediately Delete an Uploaded File on that new object and you would present an error to the user.)

no need to wait…do it now. you get the file name back from the uploader…either use regex to grab the file extension or @jarrad has a plugin to check the MIME and then run a workflow to either accept or delete

That works for file type. What about limiting the file size?

Any update on this? Can files be limited to file type?

1 Like

You can get the file extension from the file name with regex and display a message that the upload is not allowed.

The same way it should be possible to get the filesize and reject the file …

It is also possible to change the file upload window and limit it to specific file types. For this you probably have to create a new uploader plugin.

Is this still an issue you’re having? I came up with an interesting way to pull it off. It’s not fool proof, but it certainly helps a lot!

Let me know and I’ll share…

Again, not a perfect solution, but if the file type isn’t in the file name it will reject it. So, in this case if no .pdf, then it will delete the upload, reset the inputs and then display an error message.

Hope this helps someone…

1 Like

Hi Tim! You can use file name truncated from end to 4 is/not “.pdf” for extra security.

I see you make other comments about file upload, I have integrated this plugin from Zeroqode today and I am happy with the performance. Here you see the limit of file.

1 Like

Can users download the files I’ve uploaded to AWS as well?

Do you mean from a privacy concern? I’m not sure exactly.

If you mean regularly then yes but not with the plugin itself you can find another plugin or some simple script to download files.

I’m selling beats

So say I upload an audio file using that plug-in and post it for sale. Then a customer comes along and buys the audio file. Will I still be able to create a download button for them after purchase?