jquery file upload,1.9MB image file is too big?

119 Views Asked by At
$("#pic_upload").fileupload({
    dataType: "json"
    , minFileSize: 1
    , maxFileSize: 10485760 //10 MB
    , acceptFileTypes: /(.|\/)(gif|jpe?g|png|bmp)$/i
}).on("fileuploadprocessalways", function(e, data) {
    var currentFile = data.files[data.index];

    if(data.files.error && currentFile.error) {
        alert(currentFile.error);
        data.abort();
    }
}).on("fileuploaddone", function(e, data) {
    console.log(data);
    data.context = 
        $("<li class='file done' id='file_" + data.files[0].name + "'>").append(
            $("<div class='pic_list_wrap'>").append(
                $("<span class='img'>").append(
                    $("<img src='" + data.result.files[0].url + "'>")
                )
            ).append(
                $("<span class='imgDeleteBtn' style='cursor: pointer;'>")
            )
        ).appendTo(document.getElementById("pic_list"));
    
    data.context.find("span.imgDeleteBtn").on("click", {filename: data.files[0].name, files: data.files},function(event) {
        var removeItem = $(document.getElementById("file_" + event.data.filename));
        removeItem.remove();
        data.files.length = 0;
        pictureCount -= 1;
        writeFormData.delete(pictureCount);
    });
    
    writeFormData.append(pictureCount, data.files[0]);
    pictureCount += 1;
});

result console screen

When i using the demo of plugin, it can upload 10+ Mb files

but with my code... it can't upload just 1.9Mb image file

i can upload without the plugin but i want to use it

how can i solve this problem????

0

There are 0 best solutions below