jQuery fileupload with hidden files

102 views Asked by At

I load pictures using jQuery fileupload with follow params:

this.$('input[type=file]').fileupload({
    dataType: 'json',
    autoUpload: false,
    url: this.data.url || '/files/upload',
    acceptFileTypes: /(\.|\/)(gif|jpe?g|png)$/i,
    previewMaxWidth: 512,
    previewMaxHeight: 512,
    previewCrop: true
});

Pay attention to line acceptFileTypes: /(\.|\/)(gif|jpe?g|png)$/i,. This line allows only pictures, BUT there is one problem. It's working with hidden files (e.g: file with name .jpg) How to restrict such files?

0

There are 0 answers