Streaming live at 10am (PST)

Change form file upload maximal file size

Hey webflowers :wave:t3:

I’ve built a webflow form which automatically uploads submissions via zapier to a cms collection inside webflow. Inside of this form I use the file upload field to upload a thumbnail image to the collection. Now I’ve encountered a unexpected problem:

Max. file size for file upload field is 10MB.
Max. file size for collection images is 4MB.

this makes it possible, that users can submit images that then won’t get uploaded to the cms because of the 4MB limit. Now here is my question:

Is there any way, to limit the file size of the file upload field to less then 10MB?

I’m working with a lot of custom code on this site so a quick js- or jquery-script would be perfect for me.

a read-only-link or link to my site is in this case not needed I think, since the solution (if possible) should be easy to implement on multiple sites.

just solved it. for anyone interested, this is my code:

$("[type=file]").change(function() {
    if(this.files[0].size > 3000000){
       this.value = "";
       $(this).siblings(".file__error").css("display", "block")
    else {
    	$(this).siblings(".file__error").css("display", "none")

file__error = The class of an element placed next to the input-element which shows the alert message.
3000000 = The new file size limit (in this case 3 MB)