Pow server:get uploaded file

From PlainOldWebserver

Jump to: navigation, search

Back to Top


pow_server.get_uploaded_file()

Files uploaded through a form can be retrieved. Here is a form and SJS checking for an uploaded file, and showing it if it exists.

  <form enctype="multipart/form-data" action="/upload.sjs" method="POST">
     <input type="hidden" name="MAX_FILE_SIZE" value="3000000" />
     Send this file: <input name="userfile" type="file" />
     <input type="submit" value="Send File" />
  </form>
  <?sjs
     document.writeln("Filname: "+pow_server.POST_FILENAME+"<br>\n");
     document.writeln(pow_server.get_uploaded_file());
  ?>

Result:

   Filname: test.sh
   echo hello

See Also

Personal tools
Navigation