[CLOSED] multiple file upload and file size at client side

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1

    [CLOSED] multiple file upload and file size at client side

    Hi

    I am looking to upload multiple files with computing file sizes at client side before submitting to the server. After searching through the forums, I found out that it was not possible due to security reason (at least for filesize) or alternatively use swfupload.

    I have a the following whcih works under chrome and firefox, is there a way to extend ext:FileUploadField in a similar way?

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html>
    <head>
    <script type="text/javascript">
    function setUploadSize(el,id1,id2)
    {
        var size=0;
        for(var num1=0;num1<el.files.length;num1++) 
        {
            var file=el.files[num1];
            //alert(file.name+" "+file.type+" "+file.size);
            size+=file.size;
        }
        document.querySelector("#"+id1).textContent=el.files.length;
        document.querySelector("#"+id2).textContent=Math.round(size/1000);
    }
    </script>
    </head>
    <body>
    <form>
    <input type="file" multiple="multiple" onchange="setUploadSize(this,'count','size')" /><br/>
    Total files: <span id="count">0</span>, Total Kb: <span id="size">0</span>
    </form>
    </body>
    </html>
    Last edited by Daniil; Dec 21, 2014 at 1:56 PM. Reason: [CLOSED]

Similar Threads

  1. [CLOSED] How to identify upload file size before uploading in IE?
    By rnachman in forum 1.x Legacy Premium Help
    Replies: 1
    Last Post: Jun 29, 2012, 5:54 PM
  2. Replies: 2
    Last Post: Jan 17, 2012, 8:58 AM
  3. [CLOSED] Validate file size using FileUpload in client side
    By Pablo_Azevedo in forum 1.x Legacy Premium Help
    Replies: 3
    Last Post: Oct 28, 2011, 4:12 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