Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p><strong>UPDATE 2013</strong> as of this edit, the File API is supported in all major browsers, and in IE as of version 10</p> <p><a href="http://caniuse.com/#search=file%20api" rel="nofollow noreferrer">http://caniuse.com/#search=file%20api</a></p> <p>You may still wish to use SWFUpload if you still need to support IE9 and under, though at this point it should probably be more of a fallback, since the html5 file api has support on mobile platforms where SWFUpload cannot reach. The html5 file api is based on firefox's file api as noted below.</p> <p>See also this duplicate question <a href="https://stackoverflow.com/questions/4112575/client-checking-file-size-using-html5">Client Checking file size using HTML5?</a></p> <p><strong>UPDATE:</strong> Firefox has changed their API to this <a href="https://developer.mozilla.org/en/DOM/FileReader" rel="nofollow noreferrer">https://developer.mozilla.org/en/DOM/FileReader</a></p> <p>You can do it in firefox like so</p> <p>html:</p> <blockquote> <pre><code>&lt;form action="" method="get" accept-charset="utf-8"&gt; &lt;input type="file" name="file" value="" id="file"&gt; &lt;p&gt;&lt;input type="submit" value="Continue &amp;rarr;"&gt;&lt;/p&gt; &lt;/form&gt; </code></pre> </blockquote> <p>javascript:</p> <pre><code>var filesize = document.forms[0].file.files[0].fileSize </code></pre> <p>if there's a way to do this in IE, I don't know it. It probably involves activeX or some other such rubbish.</p> <p>edit: I found this <a href="http://www.kavoir.com/2009/01/check-for-file-size-with-javascript-before-uploading.html" rel="nofollow noreferrer">here</a>, HOW TO DO THIS IN IE</p> <pre><code>&lt;head&gt; &lt;script&gt; function getSize() { var myFSO = new ActiveXObject("Scripting.FileSystemObject"); var filepath = document.upload.file.value; var thefile = myFSO.getFile(filepath); var size = thefile.size; alert(size + " bytes"); } &lt;/script&gt; &lt;/head&gt; &lt;body&gt; &lt;form name="upload"&gt; &lt;input type="file" name="file"&gt; &lt;input type="button" value="Size?" onClick="getSize();"&gt; &lt;/form&gt; &lt;/body&gt; &lt;/html&gt; </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload