How to define filters in plupload

790 views Asked by At

I use plupload. Plupload allows me to select files which extensions did not defined in settings. For example I can select and upload .rar or .txt files. But I do not define these extensions in filters.

$(".uploadDocs").click(function () 
{
    //var extensions = $(this).data("ext");

    $("#pluploadUploader").pluploadQueue(
    {
        runtimes: 'html5',
        url: "Upload",
        filters: 
        {
            // Maximum file size
            max_file_size: '10mb',
            // Specify what files to browse for
            mime_types: 
            [
                { title: "Image files", extensions: "jpg,gif,png" },
                { title: "Zip files", extensions: "zip" }
            ]
        },
    }, 
    {
        FileUploaded: function (up, file, data) 
        {
            var out = JSON.parse(JSON.parse(data.response));
            uploadedFiles.push(out.UploadedFileName);
        }
    });
});
1

There are 1 answers

0
AudioBubble On

I checked my jquery.plupload.queue.js and plupload.full.min.js versions. I work on a template project from themeforest. And I saw that my current .js files versions not up to date. So I updated .js files to the latest version and plupload works well now.