473,479 Members | 2,085 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

force a file to save to computer

Is there a way or method to make a file be saved to the computer instead of
being opened on the web? we wrote a web client messaging system that uses
SSL on our server and when you open a word doc as an attachment it of course
opens in the browser... we want to force the user to save it to the computer
(at the least give them a dialog asking what they want to do with it)
instead of just opening it right to the browser... any way to do this?
thanks
Nov 19 '05 #1
3 1709
Yes, you can force a dialog box that will ask the user whether they'd like
to open or save the file.

Response.Clear()
Response.ContentType = Whatever
Response.Writefile("c:\whatever")
Response.AddHeader("Content-Disposition",
"attachment;filename=whatever")

Here are the details:
http://steveorr.net/articles/EasyUploads.aspx

--
I hope this helps,
Steve C. Orr, MCSD, MVP
http://SteveOrr.net
"Brian Henry" <br**********@newsgroups.nospam> wrote in message
news:%2****************@TK2MSFTNGP15.phx.gbl...
Is there a way or method to make a file be saved to the computer instead
of being opened on the web? we wrote a web client messaging system that
uses SSL on our server and when you open a word doc as an attachment it of
course opens in the browser... we want to force the user to save it to the
computer (at the least give them a dialog asking what they want to do with
it) instead of just opening it right to the browser... any way to do this?
thanks

Nov 19 '05 #2
thanks!

"Steve C. Orr [MVP, MCSD]" <St***@Orr.net> wrote in message
news:eK****************@TK2MSFTNGP10.phx.gbl...
Yes, you can force a dialog box that will ask the user whether they'd like
to open or save the file.

Response.Clear()
Response.ContentType = Whatever
Response.Writefile("c:\whatever")
Response.AddHeader("Content-Disposition",
"attachment;filename=whatever")

Here are the details:
http://steveorr.net/articles/EasyUploads.aspx

--
I hope this helps,
Steve C. Orr, MCSD, MVP
http://SteveOrr.net
"Brian Henry" <br**********@newsgroups.nospam> wrote in message
news:%2****************@TK2MSFTNGP15.phx.gbl...
Is there a way or method to make a file be saved to the computer instead
of being opened on the web? we wrote a web client messaging system that
uses SSL on our server and when you open a word doc as an attachment it
of course opens in the browser... we want to force the user to save it to
the computer (at the least give them a dialog asking what they want to do
with it) instead of just opening it right to the browser... any way to do
this? thanks


Nov 19 '05 #3
JV
Nice post Steve.

"Steve C. Orr [MVP, MCSD]" <St***@Orr.net> wrote in message
news:eK****************@TK2MSFTNGP10.phx.gbl...
Yes, you can force a dialog box that will ask the user whether they'd like
to open or save the file.

Response.Clear()
Response.ContentType = Whatever
Response.Writefile("c:\whatever")
Response.AddHeader("Content-Disposition",
"attachment;filename=whatever")

Here are the details:
http://steveorr.net/articles/EasyUploads.aspx

--
I hope this helps,
Steve C. Orr, MCSD, MVP
http://SteveOrr.net

Nov 19 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

17
2437
by: Will Stuyvesant | last post by:
Here is a question for people who are more comfortable than I am with new Python stuff like generators. I am having fun implementing things from the Wizard book (Abelson, Sussman, "Structure and...
27
5038
by: Curious Angel | last post by:
I have a resume in PDF format and I want anyone who LEFT-OR-RIGHT clicks the link to force the file to be saved, and in any event _not_ opened. Since the PDF will be in his cache in any event, I...
4
21921
by: Kevin Muenzler, WB5RUE | last post by:
How do I force a browser to download a file instead of displaying it? In other words I have a page with MP3 and WMA files on it and I would like for the visitor to download the file instead of...
0
2097
by: PJS | last post by:
Thanks in advance. I have a site which generates a user specific XML document. The user then selects "Save to PC" which then forces the browser to show the "save/download" dialog box. The code...
1
1458
by: Mullin Yu | last post by:
I want to open a file by the native application without opening the Dialog Box asking "Open, Save or Cancel" . I know I can do at the client workstation by selecting the registry. But, I don't...
4
1683
by: tma | last post by:
Short of zipping my file, are there any other alternatives to the below? I'm trying to add anchors in code and I need the link to force a download of the .pdf rather than open a new window or...
5
3461
by: Patrick | last post by:
Following on from the excellent example at http://www.c-sharpcorner.com/Code/2003/Sept/ExportASPNetDataGridToExcel.asp on how to save a data-grid to excel file, how can I extend the example such...
2
2039
by: Jon | last post by:
I have the following functionality in my program when someone clicks on a link, it brings up a page with an excel doc in it. I would however, like it to force the save file dialog all the time,...
1
1530
by: greg | last post by:
Hi I have a link on a page that points to a file inside the site that I want to be downloaded loke in page_load I write linkFile.NavigateUrl = Request.ApplicationPath + "/somepath/file.iif";...
0
7027
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7019
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
7067
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
6719
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
6847
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
5312
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
4757
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
4463
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
166
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.