Persits Software, Inc. Knowledge Base Articles

800A0005 Access is denied error

Problem Description

When uploading a file with AspUpload, the line of code

Count = Upload.Save(foldername)

or

Count = Upload.SaveVirtual(virtfoldername)

generates the following error:

Persits.Upload.1 (0x800A0005)
Access is denied.

Solution

Scenario 1: Upload directory is local.

This is an NTFS permission problem. The current user (such as IUSR_machinename) 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. To change permissions on a folder, right-click on it in Windows Explorer, then select Properties/Security.

Scenario 2: Upload directory is remote.

To avoid the Access is Denied error when saving to a remote UNC path such as \\server\share\dir, you should call the method Upload.LogonUser to impersonate an admin account, as follows:

Upload.LogonUser "domain", "username", "password"
Upload.Save "\\server\share\dir"