0

I'm using jQuery File Upload UI : https://github.com/blueimp/jQuery-File-Upload/

I'm trying to set a max upload file size depending on the file extension. If the file is a video, set maxFileSize: 250Mb else set maxFileSize: 100Mb.

It's easy to set a general maxfilesize, but is it possible to make it more granular ?

Thank you all !

Jaycreation
  • 2,029
  • 1
  • 15
  • 30

1 Answers1

0

I think you need to do something like this in add

var uploadFile = data.files[0];
    if (!(/\.(mp4)$/i).test(uploadFile.name)) {
        if (uploadFile.size > 50000000) { // 2mb
            // Do something here
        }
    } else if (!(/\.(flv)$/i).test(uploadFile.name)) {
        if (uploadFile.size > 50000000) { // 2mb
            // Do something here
        }
    }
Junaid Atique
  • 485
  • 1
  • 5
  • 19