I have read through all the postings here that refer to "access denied" messages but none of them seem to apply to what I'm seeing. The code works fine if the source file is on a local drive, but when it's on a network location (accessed either via UNC or a drive mapping), I get the error below.
I have verified that I have full permissions to the location of the source file, the location of the destination PDF file, and to the %WINDIR%\Temp directory. The error occurs in a test Windows application and in a Windows service (both running as the same domain user that has full access to everything).
Thank you,
Chris
Code:
ConversionOptions pdfOptions = new ConversionOptions(false);
try
{
Converter.Convert(@"\\servername\hold\I4000355.tif", @"C:\Temp\BasicTest.PDF", pdfOptions);
}
catch (Exception ex)
{
txtOutput.AppendText("Error processing file - Source = " + ex.Source +
Environment.NewLine + "Message:" + Environment.NewLine + ex.Message +
Environment.NewLine + "Stack Trace:" + Environment.NewLine + ex.StackTrace + Environment.NewLine);
}
Access to the path '\\servername\hold\I4000355.tif' is denied.
Stack Trace:
at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)
at System.IO.FileStream.Init(String path, FileMode mode, FileAccess access, Int32 rights, Boolean useRights, FileShare share, Int32 bufferSize, FileOptions options, SECURITY_ATTRIBUTES secAttrs, String msgPath, Boolean bFromProxy)
at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, FileOptions options, String msgPath, Boolean bFromProxy)
at System.IO.FileStream..ctor(String path, FileMode mode)
at ceTe.DynamicPDF.Conversion.Converter.a(String A_0, Boolean A_1)
at ceTe.DynamicPDF.Conversion.Converter.a(String A_0, String A_1, ConversionOptions A_2)
at ceTe.DynamicPDF.Conversion.Converter.Convert(String sourceFilePath, String outputFilePath, ConversionOptions conversionOptions)
at ceTe.DynamicPDF.Conversion.Converter.Convert(String inputFilePath, ConversionOptions options, Byte[] appendToPdf)
at DynamicPDF_Tester.Form1.MakePDF(String[] sFilenames) in C:\Code\DynamicPDF Tester\Form1.cs:line 210
Access Denied
Re: Access Denied
Support · Feb 23, 2011Hello Chris,
The account under which your application is running should at least have Read, Read & Execute and Write permissions in order for the API to access the TIFF file and convert it. You said the user account has full permissions to the location of the source file, please check the permissions on the specific file you are converting to see if the file is inheriting the parent folders permissions.
Thanks,
ceTe software Support Team.
Re: Access Denied
Forum member · Feb 23, 2011Hi. Thank you for getting back to me. The account does have full permissions to the file as well. I've tried it on a number of different files too. The only commonality seems to be that the process works on local files but doesn't work on network-located files.
As a workaround, I've added code to copy the original file to a local temporary directory and process it through DynamicPDF from there. This works.
Thanks,
Chris