downloading a file
I am creating a web application to convert files to a different
format. The interface is simple in that there's a filename control
and a submit buttom. The functionality I'm looking for is for the
user to use the filename control to indicate which file to convert,
then to press submit, the file is then uploaded to the application,
converted, and then the response for the user would be a 'Save file
as..' dialog, and they then can indicate where to save the converted
file. I have got everything working up to the point where I have to
respond with the new file. I can't figure out how to set it up so
that their browser expects to download a file. I would ideally like
to stick the converted file in the Response object but there doesn't
seem to be a function for this. I also wish to avoid placing the file
somewhere else and then replying with a link for them to follow to get
at this file. Is there a clean way to do this?
Re: downloading a file
Use something like this
context.Response.ContentType = "Application/pdf"
context.Response.ContentType = "Application/msword"
context.Response.ContentType = "Application/x-msexcel"
context.Response.ContentType = "application/octet-stream"
If you want this to be downloaded then
filename=" & strFileName)
If you want the browser to open it using the default viewer then use
context.Response.AddHeader("content-disposition", "filename=" &
Trevor Benedict R
*** Sent via Devdex http://www.devdex.com ***
Don't just participate in USENET...get rewarded for it!
|All times are GMT. The time now is 12:15 AM.|
Powered by vBulletin®. Copyright ©2000 - 2014, vBulletin Solutions, Inc.
SEO by vBSEO ©2010, Crawlability, Inc.