Open a file outside the Web Folder

I am creating a document management system that will save files to network drives in various folders.
These folder will not be inside the same folder structure as the web site that accesses them.

How do I access these files so that people can download them.
ie. window.open("Z:/files/test.pdf") or set this as a A tag.

I am starting to think that the only thing that I could do is copy a temp file to the Web Folders and use from there.

Any ideas?
I am using ASP.NET
lawsoAsked:
Who is Participating?
 
Ted BouskillSenior Software DeveloperCommented:
Then you should look for samples on writing to the HttpResponse Stream.  CAPTCHA samples use that technique.  In fact, if you search this site I and others have answered questions about writing to that stream.

Basically what you do is open a stream to read from the file.  You then redirect that stream to the HttpResponse object as an OutputStream to the client's browser which will then show the [Save As] dialog box.
0
 
Ted BouskillSenior Software DeveloperCommented:
Are you going to trigger the download through a web page?
0
 
lawsoAuthor Commented:
Yep.
At the moment I am trying to add an Attribute to an ImageButton that will open in another window.
0
 
lawsoAuthor Commented:
Great idea... sometimes it is good to add another head to an problem.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.