To allow file uploads, NTFS permissions must be set appropriately for FileUp's temporary and destination directories. The IUSR_MACHINENAME or authenticated user account must have Read, Write, and Modify access to this folder. For more information, see Setting Appropriate Security. |
Here is a simple HTML form that uploads a file:
The Client Code |
---|
<html>
|
When using an HTML form to upload files, the form submitting the file must contain:
<form>
tag attribute enctype="multipart/form-data"
.<input type="file" />
tag, including a name
attribute.
The form uploads the file to formresp.asp (specified by the <form>
tag's action
attribute). Formresp.asp contains the following code:
The Server Code |
---|
<%@ language="vbscript" %>
|
The following lines process the upload request, and save the uploaded file
Set fileUpload = Server.CreateObject("SoftArtisans.FileUp")
FileUp
object.fileUpload.Path
= "C:\temp"
fileUpload.SaveAs
"C:\uploads\upload.out"
The Path
propery must be set before referencing any variables on the
form. As soon as a form element is referenced, FileUp will read in the entire contents
of the HTTP post, including all form elements and files. Therefore, if you set Path
after referencing a form element, by the time the Path
property is set, all of the Form data will have been read, and the cache files created,
rendering the Path assignment meaningless.
If you do not set the Path
property, FileUp will cache the upload in
the server's default directory for cached files.
<form>
tag attribute enctype="multipart/form-data"
.<input type="file">
tag, including a name
attribute.