Saving a file to another server
What kind of path would I use to save a file (.pdf) on another server/network drive?
Say I have rights to a network drive 'optamail1' and a folder there called datasheets开发者_开发问答. I can access this folder from "Run" using \\optamail1\datasheets\
, however, this kind of path will not work in my application. Has anyone tried doing this before?
Thanks, Nick
You need to grant access to the network share to the user that the ASP.Net application is running as.
To save "report.pdf" at "\optamail1\datasheets\", you would just use the path "\optamail1\datasheets\report.pdf" as normal. You should enclose the save operation inside a try/catch and check for exceptions in case: the path doesn't exist, net is down/computer not accesible, or you don't have permission to write on that path.
精彩评论