<%
n
= Upload.Save "c:\upload"
For
Each File in Upload.Files
File.Copy
Upload.Form("Path") & "\" & File.ExtractFileName
Next
%>
A: No. Early versions of the ASP's Request
object did not provide the BinaryRead
or TotalBytes methods which the
component heavily relies on. The best way to test whether your version
of ASP allows uploading is to execute a simple script like <%
n = Request.TotalBytes %> and see if the method is recognized by
your ASP module.
A. You need to install the Microsoft Option Pack
4.0.
A: One possible reason is that your version of ASP is old. See Q2
and Q3. Another possible reason is that you forgot to include the
METHOD=POST
attribute in your form.
A. In most cases it means that your upload script calls the Request
object prior to calling Upload.Save. You must never use Request.Form in
your upload script, use Upload.Form instead.. It may also mean that your
version of ASP is old and does not support the Request.BinaryRead method.
See Q2 and Q3.
Microsoft VBScript runtime error '800a01ad'
ActiveX component can't create object
A. It is a permission problem. Make sure Everyone
has Full Control over AspUpload.dll.
A. Set the Session.Timeout property
to some large number such as 200 (in minutes) before calling Upload.Save.
A. Yes. Unlike Request.Form, the Upload.Form collection will store each selected string as an individual item, but under the same name. You can access all selected strings as follows:
<%
For
Each Item in Upload.Form
If Item.Name = "Choice" Then Response.Write Item.Value & "<BR>"
Next
%>
Persits.Upload.1 error '800a0005'
Access is denied.
A. This is an NTFS permission problem. The current user (such as IUSR_xxx)
must have Full Control over the upload directory to be able to create files
in it. You can instantly fix this problem by giving Everyone Full Control
over the upload directory, then tighten security as appropriate.
Persits.Upload.1 error '800a001e'
A required privilege is not held by the client.
A. Most probably, your virtual directory has the "Run in separate memory
space" option checked. This causes Windows NT to disallow calling LogonUser
unless the user has the privilege "Act as Part of Operating System". You
have two options: disable "Run in separate memory space" for this virtual
directory, or grant this privilege to all the users of your application
such as IUSR_xxx (go to User Manager, select Policies/User Rights, check
"Show Advanced User Rights", select "Act as Part of Operating System",
add desired users).
A. No, and there is a good reason for that. If setting a default value
for <INPUT TYPE=FILE> were allowed, one could easily write an HTML page
that would steal files from a user's machine without his/her knowledge
or permission. Although pure HTML won't help you, there is still a way
to specify a file for uploading programmatically: use a client-side upload
agent such as the XUpload ActiveX control available from www.aspupload.com.