Ns getformfile

From AOLserver Wiki
Jump to navigation Jump to search

NAME

ns_getformfile - Return a tempfile for a form file field.

SYNOPSIS

ns_getformfile fileUploadFormFieldName

DESCRIPTION

Briefly, use:
<form enctype="multipart/form-data" action="url" method=post>
First file: <input name="file1" type="file">
Second file: <input name="file2" type="file">
<input type="submit">
</form>
and then access with:
set tmpfile1 [ns_getformfile file1]
set tmpfile2 [ns_getformfile file2]
set fp1 [open $tmpfile1]
set fp2 [open $tmpfile2]
Temp files created by ns_getform (which is called by ns_getformfile) are removed when the connection closes.