1

Possible Duplicate:
Local file access with javascript

I have this code :

<form onSubmit="return checkFile();" enctype="multipart/form-data" method='POST' action="index.php?status=import" >
    <input name="tracklistFile" type="file" value="CHOOSE" />   
    <input type="submit" name="send" />
</form>

and I'd like, before submit it to the server, call that function checkFile(), that must open this file, read it and do some check operations.

  1. Can I do it on Javascript?
  2. Is it better (cause cross-browsers) use a framework? (jQuery?)

Thanks

P.S. Of course I'll do the same check operations of the file on server side, but I'd like to test it also client-side

Community
  • 1
  • 1
markzzz
  • 47,390
  • 120
  • 299
  • 507

1 Answers1

4

It is not possible to access/open any files using javascript. The browser security system will not allow this.

It is same as this question

Community
  • 1
  • 1
Arun P Johny
  • 384,651
  • 66
  • 527
  • 531