0

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

Joel Coehoorn
  • 399,467
  • 113
  • 570
  • 794
Nick Rolando
  • 25,879
  • 13
  • 79
  • 119
  • Why won't this path work in your application? Have you tried it? What happens? – Cameron Mar 21 '11 at 22:12
  • why would it not work in your application? – vlad Mar 21 '11 at 22:13
  • See the comments to this answer: http://stackoverflow.com/questions/940529/how-can-i-demand-access-to-a-windows-share-in-a-net-thick-client-app/940757#940757 – Soonts Mar 21 '11 at 22:45

2 Answers2

5

You need to grant access to the network share to the user that the ASP.Net application is running as.

SLaks
  • 868,454
  • 176
  • 1,908
  • 1,964
0

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.

DaniH
  • 41
  • 4