8. cgi::SaveFile("param","filename")

[<<<] [>>>]

This function can be used to save an uploaded file into a file on disk. The first argument is the name of the CGI parameter. The second argument is the desired file name. This file will be created and the content of the uploaded data is written into it. If the file already existed it is going to be deleted.

Note that the first argument is the name of the CGI parameter and not the name of the file. This is the string that appears in the tag name in the input field of type file. In the following example the argument should be "FILE-UPLOAD-NAME".

<FORM METHOD="POST" ACTION="echo.bas" ENCTYPE="multipart/form-data">
<INPUT TYPE="FILE" VALUE="FILE-UPLOAD-VALUE" NAME="FILE-UPLOAD-NAME">
<INPUT TYPE="SUBMIT" NAME="SUBMIT-BUTTON" VALUE="UPLOAD FILE">
</FORM>

Files are uploaded in binary format. This means that applications accepting text file uploads should take care of the conversion. The current version of the CGI module does not support the conversion process.

The CGI parameter names are case sensitive according to the CGI standard.


[<<<] [>>>]