Persits Software, Inc. Knowledge Base Articles

AspPDF - Opening Output file failed: Access is denied error

Problem Description

When generating a PDF document with AspPDF, the line of code

Doc.Save Path

generates the following error:

Persits.PdfManager.1 error '800a002e'
Opening Output file failed: Access is denied.

Solution

This is an NTFS permission problem. The current user (such as IUSR_machinename) must have Full Control over the destination directory to be able to create files in it. You can instantly fix this problem by giving Everyone Full Control over the destination directory, then tighten security as appropriate. To change permissions on a folder, right-click on it in Windows Explorer, then select Properties/Security.

If you are getting this error when running any of the code samples that come with AspPDF, it is recommended that NTFS permissions be adjusted on the \Samples directory and all subdirectories. Using Windows Explorer, right-click on the directory c:\Program Files\Persits Software\AspPDF\Samples, select the Security tab and give the "Everyone" account full control over this folder. Click "Advanced..." and make sure the checkbox "Reset permissions on all child objects..." is checked, as follows: