Click here to Skip to main content
15,892,161 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi

I am sitting with a problem where I am trying to write a PDF file to a folder inside of my solution e.g JunkFolder.

Can any 1 please advise me on how I can do this?

Anton
Posted

1 solution

You would need to use Server.MapPath to get the correct folder:
http://msdn.microsoft.com/en-us/library/ms524632%28VS.90%29.aspx[^]

Good luck!
 
Share this answer
 
Comments
Spyker55 26-Oct-10 9:01am    
Thanks for the help.

but i am experiencing a problem when my StreamWriter wants to write to a file to the folder.

the error is saying: The process cannot access the file (Path) because it is being used by another process.
E.F. Nijboer 26-Oct-10 11:01am    
Aha, so you did use Server.MapPath?
Are you using an unique name for each pdf file? You can use Path.GetTempFileName for that.
http://msdn.microsoft.com/en-us/library/system.io.path.gettempfilename%28VS.80%29.aspx

Otherwise I recommend to add some code which is giving the error (or equivalent code). Now I'm just guessing what could be/go wrong.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900