extjs - Javascript to check filesize before upload in Internet Explorer -


Is it possible to use javascript to check the file size (in the customer side) before it is actually uploaded to the server is ?

This application is built on EXTJS and Java and is restricted by Internet Explorer 7 for use on Windows XP machines. No use of ActiveX is permitted.

The workflow is such: the user selects a file to upload, checks for the file type and filesystem, kicks in the prompt immediately. If the file exceeds the limit, the GUI will indicate with an error. If the file is within the limit, then the full pathpath will be sent to upload the server end (Java servlet).

What is possible to check with the javascript file and read the full file path?

It is possible with ActiveX objects. & lt; Html & gt; & Lt; Top & gt; & Lt; Script & gt; Function getSize () {var myFSO = new ActiveXObject ("Scripting.FileSystemObject"); Var file path = document.upload.file.value; Var thefile = myFSO.getFile (file path); Var size = thefile.size; Warning (size + "bytes"); } & Lt; / Script & gt; & Lt; / Head & gt; & Lt; Body & gt; & Lt; Name of the form = "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;

Comments

Popular posts from this blog

mysql - BLOB/TEXT column 'value' used in key specification without a key length -

c# - Using Vici cool Storage with monodroid -

python - referencing a variable in another function? -