LPology / Simple-Ajax-Uploader

Javascript file upload plugin with progress bar support. Works in all major browsers, including IE7+, Chrome, Firefox, Safari, and Opera. No dependencies - use it with or without jQuery.
995 stars 267 forks source link

Settings "maxSize" isn't useful in IE #52

Closed littlefatroy closed 10 years ago

littlefatroy commented 10 years ago

No matter what "maxSize" I set in the uploader, I can still upload the file in IE when "fileSize" > "maxSize".

By the following code in the part of SimpleAjaxUploader.js:

if ( XhrOk ) { filename = ss.getFilename( this._file.name ); // Convert from bytes to kilobytes size = Math.round( this._file.size / 1024 ); } else { filename = ss.getFilename( this._file.value ); } ext = ss.getExt( filename ); if ( !this._checkFile( filename, ext, size ) ) { return; } It seems that the "size" is null when "XhrOk" = false. (IE makes "XhrOk" = false)

Does anyone know how to fix this problem? Pretty thanks!

LPology commented 10 years ago

The maxSize option only works in browsers that support the HTML5 File API -- Firefox, Chrome, Safari, IE10+.

In IE9 and older, the maxSize option will have no effect. Unfortunately, there are no work arounds to fix that.