I have a report that I currently allow the user to choose an output option (HTML or PDF) when they are supplying the report parameters (date range, filters, etc.).
I want to change the report such that it always does HTML and puts a link on the rendered HTML page so the user can grab the PDF if they want it.
How do I modify my IIS6/IIS7 configuration, user permissions, etc. to allow my site to write the PDF to the filesystem? Any C# code would be appreciated.
I plan on creating PDFs with random filenames and adding a process to cleanup old PDFs so I don’t have a disk space issue. This is a lightly used web application so I’m not worried about having lots of old PDF files hanging around.
In IIS 6 Manager, go to Application Pools and get the properties of the Application Pool your web site is running under (if you’re not sure, it’s on the web site Properties dialog > Home Directory tab). Go to the identity tab and see what user account that app pool is running under.
Then go to the target folder you want to write the PDF to, right-click and go to Properties > Security > Add and add ‘write’ for the account listed for the app pool.