10.6 Multi-part File Uploads | |
In addition to the usual variables imported from POST and GET forms, Vortex also imports variables from a form-based multi-part file upload, if the user's browser supports them. This provides an easy way to upload binary files in a form. For example, we can upload a GIF with the following form:
<FORM METHOD=post ACTION="$url/func.html" ENCTYPE="multipart/form-data"> File to upload: <INPUT TYPE=file NAME=image ACCEPT="image/gif"> <BR>Description: <INPUT TYPE=text NAME=desc> <INPUT TYPE=submit VALUE="Submit"> </FORM> |
This form would present the user with a file-select dialog box (for the $image variable) and a plain text box (for the $desc variable). On submission, the browser sends the file the user selected, and the Vortex variable $image would contain the contents of that file - a GIF image if the user selected one. Any other type variables on the form (eg. $desc ) are imported as usual.
To the user this form would look like this: