开发者

Saving a file to another server

开发者 https://www.devze.com 2023-02-19 00:02 出处:网络
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 acces

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.

0

精彩评论

暂无评论...
验证码 换一张
取 消