Go4Expert (http://www.go4expert.com/)
-   JavaScript and AJAX (http://www.go4expert.com/forums/javascript/)
-   -   File Size Validation (http://www.go4expert.com/forums/file-size-validation-t3971/)

anis 21Apr2007 17:45

File Size Validation
Hello All,
I have 125kb file on my system.I want to validate file size not more than 80kb in JavaScript. when i upload a file.Pls suggest me javascript code for this file size validation.

DaWei 30Apr2007 20:53

Re: File Size Validation
Javascript does not have the ability to do that (for security reasons). For IE you would need to have the user accept an appropriate Active-X control.

anis 1May2007 11:14

Re: File Size Validation
Is it possible file size validation in PHP using AJAX. If yes pls help me and reply soon.

pradeep 1May2007 12:34

Re: File Size Validation
Either you'll need to use an ActiveX control or you'll have to use a server-side validation.
You cannot validate filesize using AJAX 'cause that'll require posting the file, which again is not possible due to JavaScript's limited filesystem abilities.

You can also try the same with an applet, which will ensure cross-platform functioning.

All times are GMT +5.5. The time now is 05:43.