How to validate file size in javascript RRS feed

  • Question

  • I need to validate the size of the file to be uploaded in javascript. How to achieve this?

    Thanks in advance,

    Friday, January 22, 2010 5:07 PM

All replies

  • Javascript by itself cannot access your filesystem. This is a security measure. It is possible to use ActiveX (see FileSystemObject: http://msdn.microsoft.com/en-us/library/6kxy1a51(VS.85).aspx) but this solution is not cross-browser if that is a concern. I imagine you could use a java applet to do this as well. Otherwise, you need to check on the server side.

    Friday, January 22, 2010 6:56 PM