i am trying to make the javascript validation for images..
For example i tried to upload the file "c:\folder\file.exe"
It should check the extension , if the extension is not image type
should give alert..
what i want?
1> i want to know if there is any function in javascript
that reads the extension of full path like "c:\folder\file.exe"
2> file size
Thanks in advance to all of you !!
js validation for image ??
Moderator: General Moderators
- superdezign
- DevNet Master
- Posts: 4135
- Joined: Sat Jan 20, 2007 11:06 pm
Considering the image being uploaded is on the client's computer, you could dynamically display it from their computer. Just trigger it to display whatever's written in the uploading field by setting the image's src to "file///" + whatever's in the field onChange. I'm not to sure of the security on that method, but in theory it should work as long as the user inputs the filename through the browse button.