explanation of file upload handling?

12 views
Skip to first unread message

Jim

unread,
Dec 3, 2010, 6:49:47 PM12/3/10
to firef...@googlegroups.com
The get uploaded file page says:

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

======

Won't the sjs code get executed as soon as the form is displayed and, therefore, do nothing? Or, is the reader expected to understand that the form and sjs code go in separate files?






HOTmike

unread,
Dec 4, 2010, 8:17:36 AM12/4/10
to FireFox POW - Users Group
A few quick questions on this (because I have a POW already working
for me that I'd rather not mess with just for testing)

1: does this mean POW now accept POST vars (not files) submitted with
enctype="multipart/form-data" ?
2: has the leak of POST pairs into GET pairs been sealed?
3: is it now possible to upload more than one file at a time?
4: has the Uploaded File been restricted to the query that Uploaded
the file?

I ask because at present I'm stuck with grabbing RAW_POST at query
start and parsing POST and FILES (and the clean GET) from that, which
is cumbersome at best.

tia
~ Mike
Reply all
Reply to author
Forward
0 new messages