Ns getformfile

From AOLserver Wiki
Revision as of 01:37, 11 October 2009 by Akhassin (talk | contribs)
Jump to navigation Jump to search

NAME

ns_getformfile - Return a tempfile for a form file field.

SYNOPSIS

ns_getformfile fileUploadFormFieldName

DESCRIPTION

  1. Briefly, use:
  2. <form enctype="multipart/form-data" action="url" method=post>
  3. First file: <input name="file1" type="file">
  4. Second file: <input name="file2" type="file">
  5. <input type="submit">
  6. </form>
  7. and then access with:
  8. set tmpfile1 [ns_getformfile file1]
  9. set tmpfile2 [ns_getformfile file2]
  10. set fp1 [open $tmpfile1]
  11. set fp2 [open $tmpfile2]
  12. Temp files created by ns_getform are removed when the connection closes.