Javascript validation for file to be uploaded

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Rohan Gavaskar
    New Member
    • Jul 2011
    • 1

    Javascript validation for file to be uploaded

    How can i validate the file that is to be uploaded? I want that only jpeg file should be uploaded. I know, its simple and many webpages has the solution but.... that method has a loop hole.
    That method allows the uploading of any other image type if user just rename that extension by jpeg.
    I dont want that.
    I want that only real jpeg files should be uploaded
    Thanking you in anticipation
    Any slightest hint will be appreciated
  • Dormilich
    Recognized Expert Expert
    • Aug 2008
    • 8694

    #2
    there is no reliable way to determine with JavaScript, whether the file actually is a jpeg.

    there are things, that JavaScript is not intended to do and file handling is among them.

    Comment

    Working...