Free Support Forum - aspose.com

Permission Problems

I have a VS 2005 VB Web application that pulls a template from a directory, uses mail merge to populate fields and sends it straight to the user's browser. Another portion allows the user to select multiple templates, combines them and also sends them directly to the user.

I had originally put the templates on a UNC path, and that worked on my development machine, but as soon as I put the application server I started getting "Access to the path //server/$share/dir/ is denied." errors. I'm not sure what user this would be running as, I tried Network Service and even giving full access to Everyone and never got rid of it.

As a workaround I moved the files locally, into a subfolder inside of the application on the server. This resolved the template issue, but when I try to combine the templates I get a "Access to the path c:/inetpub/wwwroot/application/templates is denied." Again I tried giving everyone full access but am still getting this error. This doesn't make a lot of sense.. as I would think giving Everyone full access would cover it. Also I'm not sure why this would work on one template, but not when combining two.. I thought both were done without writing anything out to the hard drive.


Any guidance would be greatly appreciated.

Thanks,
Mirek

Hi

Thanks for your request. I didn’t manage to reproduce this issue on my side. You can try to load your file into the stream and then create Document object. See the following code snippet.

string filePath = @"286_99515_felicity\in.docx";

byte[] file = File.ReadAllBytes(filePath);

MemoryStream stream = new MemoryStream(file);

Document doc = new Document(stream);

If you will get the same error then this is problem with permissions.

Best regards.