What's New

About AspUpload
Code Samples
Live Demo

JUpload NEW
AspJpeg NEW


Other Products

Contact Us

Newsletter Signup

For more technical support information, visit our searchable database of articles at SUPPORT.PERSITS.COM.

Q1. I want to let my users specify the destination directory to which the files will be uploaded.  I included  <INPUT TYPE="TEXT" NAME="PATH"> in the form, and my upload script looks like this: <% n = Upload.Save(Upload.Form("Path")) %>. However this does not seem to work.

A. You cannot use the Form collection before calling Save because it is not yet populated. The right way to do it is to upload the files to a temporary directory and then copy or move them to the specified destination directory as follows:

n = Upload.Save "c:\upload"
For Each File in Upload.Files
File.Copy Upload.Form("Path") & "\" & File.ExtractFileName

Q2:  Will AspUpload work with any version of ASP?

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.

Q3:  Where can I get the latest version of ASP?

A: You must install the Microsoft Option Pack 4.

Q4: Whenever I try to upload a file I am getting the error Persits.Upload.1 error '800a0003', Nothing has been posted. Why?

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.

Q5: I am getting the error Persits.Upload.1 error '800a0001', Request.BinaryRead Failed. What does it mean?

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. This error may also mean that your version of ASP is old and does not support the Request.BinaryRead method. See Q2 and Q3.

Q6:  Why am I getting the following error:

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.

Q7: When uploading large files, my script times out. What can I do to prevent it?

A. Set the Server.ScriptTimeout property to some large number such as 200 (in minutes) before invoking your upload script.

Q8: I am using the control  <SELECT NAME="Choice" MULTIPLE> in my upload form. I noticed that Upload.Form("Choice"), unlike Request.Form("Choice"), only returns one of the selected string. Is it possible to access all selected strings in this control?

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>"

Q9. When I attempt to upload a file I always get the following error. Why?

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.

Q10. I want to use the LogonUser method to impersonate an admin account in order to be able to save files on a remote machine. However, I always get the error

Persits.Upload.1 error '800a001e'
A required privilege is not held by the client.

A. Windows NT/IIS4: 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). We recommend that you reboot after that.

Windows 2000/IIS5: Run Internet Services Manager. Right-click your virtual directory and select "Properties". On the "Virtual Directory" tab, set the "Application Protection" option to Low. If the option is disabled, click on the "Create" button first.

Q11. I am trying to specify a default value for an <INPUT TYPE=FILE> item on my form, but the browser seems to ignore the VALUE attribute of this tag. Client-side JavaScript does not help either. Is there a way I can programmatically specify a file for uploading?

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.

Q12. Why is the line Set Upload = Server.CreateObject("Persits.Upload") generating the error

Server object error 'ASP 0177 : 8002801d'
Server.CreateObject Failed
Library not registered.

A. This error usually occurs because of tight security settings in the HKEY_CLASSES_ROOT section of the registry. To fix the error, run regedt32 and select the key HKEY_CLASSES_ROOT\TypeLib\{B4E1B2DE-151B-11D2-926A-006008123235}. From the Security menu, select Permissions. Add Everyone to the permission list and assign Full Control to the Everyone account. Make sure the setting propagates to the sub-keys as well.

Q13. I am using the file download feature of AspUpload (the SendBinary method). However, whenever I try to download a text or MS Word file, it opens in the browser rather than prompting me to save it on disk. How can I force a "Save As" dialog?

A. Use the following download script (requires AspUpload 2.1):

Set Upload = Server.CreateObject("Persits.Upload.1")
Upload.SendBinary Request("File"), True, "application/octet-stream", True

Copyright © 1999 Persits Software, Inc.
All Rights Reserved
Questions? Comments? Write us!