[CLOSED] How to identify upload file size before uploading in IE?

  1. #1

    [CLOSED] How to identify upload file size before uploading in IE?

    Hi,

    I have to restrict the maximum upload file size is something like 25MB. The following javascript code working fine with fileuploadfield in Chrome and Firefox but not in IE. Is there any way to check this in IE?

    
                var ret = true;
    
                if (Ext.isIE) {
                    return;
                }
                var size = 0;
                var names = '';
                for (var num1 = 0; num1 < el.files.length; num1++) {
                    var file = el.files[num1];
                    names += file.name + '\r\n';
                    size += file.size;
                }
                var fileSize = Ext.util.Format.fileSize(size);
    
                if (size > 26214400) {
                    Ext.Msg.alert("File Size", String.format('You are trying to upload {0}. Max. allowed upload size is 25 MB', fileSize));
                    ret = false;
                  }             
    
                return ret;
    Last edited by Daniil; Jul 04, 2012 at 11:20 AM. Reason: [CLOSED]
  2. #2

Similar Threads

  1. [CLOSED] multiple file upload and file size at client side
    By mirwais in forum 1.x Legacy Premium Help
    Replies: 24
    Last Post: Dec 15, 2014, 5:44 AM
  2. Replies: 2
    Last Post: Jan 17, 2012, 8:58 AM
  3. [CLOSED] Error when uploading file to httphandler
    By jchau in forum 1.x Legacy Premium Help
    Replies: 5
    Last Post: Nov 09, 2011, 1:32 PM
  4. Replies: 1
    Last Post: Jun 23, 2011, 9:37 AM
  5. Maximum file size for upload
    By CoolNoob in forum 1.x Help
    Replies: 3
    Last Post: Jan 07, 2010, 3:57 PM

Tags for this Thread

Posting Permissions