Downloading/opening file in client application window
- From: "Rob Nicholson" <informed@xxxxxxxxxxxxxxxx>
- Date: Thu, 12 May 2005 11:05:24 +0100
The following code added to Page_Load works a treat:
Response.ContentType = "application/zip"
Response.AppendHeader("Content-Disposition", "attachment;
filename=DesktopChange.pdf")
Response.WriteFile("C:\Inetpub\wwwroot\Download\DesktopChange.pdf")
Response.Flush()
But *only* if the document exists in the web site or is accessible by the
ASPNET account. However, it fails if the document is stored on the network,
e.g. s:\temp\desktopchange.pdf. This isn't surprising as the ASPNET can't
access s:\Temp.
One workaround we've though of is using the upload file functionality to
upload from the client to the server into a temporary file and then serve up
this temporary file.
But this requires an upload and a download which is waste.
Anyone got any ideas how to solve this?
Cheers, Rob.
.
- Follow-Ups:
- Re: Downloading/opening file in client application window
- From: Sambathraj
- Re: Downloading/opening file in client application window
- From: Rob Nicholson
- Re: Downloading/opening file in client application window
- Prev by Date: Re: System.Threading.Timer and Dotnet 2.0
- Next by Date: RE: Unable to start debugging on the web server
- Previous by thread: Images not getting rendered when using httphandler
- Next by thread: Re: Downloading/opening file in client application window
- Index(es):
Relevant Pages
|