blueimp/jQuery-File-Upload — Issue #1004: Solving problems of Options acceptFileTypes , maxNumberOfFiles
Author: wilfredonoyola
Created: 2012-02-11 04:02:28+00:00
State: open

Problem solved!
I have also been with the same problem, but now I found the solution.
There really is no logical problem, what happens is that the scripts "main.js" there are two calls to the plugin jquery-fileupload-ui.js. It means it will run on the line where I put the (1). Then my problem was that I was adding plugin options in the plugin call on the line where I put the (2), which in this case would not be executed.

The solution:
Add plugin options in the line where I put the (1), and options for the plugin you worked, for example:
maxNumberOfFiles: 3,
acceptFileTypes: /(.|\/)(gif|jpe?g|png)$/i
/--------------------------------------------------------/
$(function () {
'use strict';

// Initialize the jQuery File Upload widget:
$('#fileupload').fileupload(); (1)
if (window.location.hostname === 'blueimp.github.com') {
// Demo settings:
$('#fileupload').fileupload({ (2)

maxNumberOfFiles: 3,
acceptFileTypes: /(.|\/)(gif|jpe?g|png)$/i
});
/----------------------------------------------------------/
I hope this explanation helps you. My English is bad, but if you doubt gladly help you ...