Advertisement
parkdream1

upload_lab1.html

Mar 3rd, 2012
227
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
HTML 0.64 KB | None | 0 0
  1. <html>
  2.  <title>Secure file upload PHP Web Applications</title>
  3.  <head>
  4.  <script language=javascript>
  5.  function chkFileExtension()
  6.  {
  7.     var str=document.upload.userfile.value;
  8.     var ext=str.substring(str.length,str.length-3);
  9.     if ( ext != "gif")
  10.     {
  11.         alert("File is invalid");
  12.         return false;
  13.     }
  14.     else
  15.     {
  16.         return true;
  17.     };
  18.  }
  19.  </script>
  20.  </head>
  21.  <body>
  22.  <form name="upload" action="upload1.php" method="POST" ENCTYPE="multipart/form-data"  onSubmit="return chkFileExtension()">
  23.  Select the file to upload: <input type="file" name="userfile">
  24.  <input type="submit" name="upload" value="upload">
  25.  </form>
  26.  </body>
  27.  </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement