Saturday, 15 September 2012

maxFileSize in blueimp file upload plugin? -


I took this plugin completely out of the box with a file limit of 2 MB, applied with an error response server side. It works great.

Then I was told to limit the file size to 5mb.

I tried everything that tried to do everything I could not get the plugin to do with anything more than 4.2MB

No errors, it Nothing does more than 4.2MB file.

The code currently sits in:

  $ ('#fileupload'). Fileupload ({type: "post", add: function (e, data) {if (files & lt; 5) {var errs = []; var acceptFileTypes = / (\. | \ /) (Gif | jpe? G | Png) $ / iFriveFileSize = 5242880; // valid file $ .EEEE (data.files, function (index, file) {if (file.type.length & amp; amp; amp ;; Amp;; acceptFileTypes test (file.type)) {errs.push ('Selected file' '+ file.name +' "is not unnecessary. Invalid file type. ');} If (this [' size ']> gt ; MaxFileSize) {errs .push ('Selected file' '+ file.name +' "is too large, '+ parseInt (file.size / 1024/1024) +' m .. file '+ parseInt (maxFileSize / 1024 / 1024) + 'M.');}}); // Output Errors Submit data (errslength & gt; 0) {Warning ('An error occurred.' + Errs.join (""));} Other {data.context = $ (' & lt; p; Attachments ($ ('. CurrUploadDiv ul')); data.submit (); removeFileUploadLabel (); Files ++; if (Files & gt; 0) {$ ( '.fileName') .html (files + 'select upload 5.')} {$ ('.fileName') .html ('Choose a file.'); }} //data.submit (); // Return; } And {$ ('.fileName'). Html ('Maximum number of selected files.'); }; }, Success: function (e, data) {// To upload multiple files, to-check replies. }, Done: function (e, data) {data.context.text (data ["_ response"] ["result"] ["message"]); }, Error: function (e, data) {console.log (e); }});  

I have needed .js files in the proper order (as indicated by the previous answer about MaxFileSize ...)

What do I miss is?

This deliberately designed by me is afraid, the following plugin has the FAQ: -

What is the maximum file size limit?

It is possible to upload files to 4 GB with the jQuery File Upload plugin. Using chunked file uploads (with a small part of 4 GB), the potential file size is unlimited. The 4GB restriction is due to some browser limitations, which can be fixed in future updates of those browsers.

So you need to upload your file into sections. You can set Chuck size using the MaxChunkSize option like this: -

  $ ('# fileupload'). Fileupload ({maxChunkSize: 10000000/10 MB});  

Keep in mind that it will not work on all browsers (I'm looking at the old version of IE!)

See the link below for help with this .


No comments:

Post a Comment