Topic: how to get file size in javascript

Hi,
I want to validate file size before uploading file . returns false once file selected morethan 2mb.
can we get filesize in javascript.please help me. it's urgent

thanks ,
lucky

Re: how to get file size in javascript

Hi,

I don't believe you can do this with javascript.  It would be a security risk to allow javascript on a third-party website to read the file-system of the computer that is accessing the site.

There are some flash solutions I have seen (that integrate with Rails) that can do this though.

Regards

Robin