M Mufasa Oct 2, 2007 #1 Is there a way to have a link in IE that will automatically run the saveas command instead of trying to open the file? TIA - Jeff.
Is there a way to have a link in IE that will automatically run the saveas command instead of trying to open the file? TIA - Jeff.
A Alexey Smirnov Oct 2, 2007 #2 Is there a way to have a link in IE that will automatically run the saveas command instead of trying to open the file? TIA - Jeff. Click to expand... Hi Jeff you can do it using code. For example, you can have a LinkButton with the following code in it protected void LinkButton1_Click(object sender, EventArgs e) { Response.ClearContent(); Response.ClearHeaders(); Response.AddHeader("Content-Disposition", "attachment;filename=test.doc"); Response.WriteFile(Server.MapPath("~/test.doc")); Response.Flush(); Response.Close(); }
Is there a way to have a link in IE that will automatically run the saveas command instead of trying to open the file? TIA - Jeff. Click to expand... Hi Jeff you can do it using code. For example, you can have a LinkButton with the following code in it protected void LinkButton1_Click(object sender, EventArgs e) { Response.ClearContent(); Response.ClearHeaders(); Response.AddHeader("Content-Disposition", "attachment;filename=test.doc"); Response.WriteFile(Server.MapPath("~/test.doc")); Response.Flush(); Response.Close(); }
G George Ter-Saakov Oct 2, 2007 #3 I believe that IE will open up the word document on IE. Depends on the settings. But I think that if you pass content type unrecognizable by browser then IE will open Save As window since it would not know what application to use. Try to add to the code bellow following line Response.ContentType="blablba"; Might work or might not George.
I believe that IE will open up the word document on IE. Depends on the settings. But I think that if you pass content type unrecognizable by browser then IE will open Save As window since it would not know what application to use. Try to add to the code bellow following line Response.ContentType="blablba"; Might work or might not George.
A Alexey Smirnov Oct 2, 2007 #4 I believe that IE will open up the word document on IE. Depends on the settings. Click to expand... It will open a dialog window.
I believe that IE will open up the word document on IE. Depends on the settings. Click to expand... It will open a dialog window.
G George Ter-Saakov Oct 2, 2007 #5 I see, because of the "attachment" in the Content-Deposition Thanks George.
G George Ter-Saakov Oct 2, 2007 #6 I found where my "believes" came from http://support.microsoft.com/default.aspx/kb/267991 turned out IE 5.5 would open file inside instead of popping dialog. despite of the attachment word. George.
I found where my "believes" came from http://support.microsoft.com/default.aspx/kb/267991 turned out IE 5.5 would open file inside instead of popping dialog. despite of the attachment word. George.
A Alexey Smirnov Oct 2, 2007 #7 I found where my "believes" came fromhttp://support.microsoft.com/default.aspx/kb/267991 turned out IE 5.5 would open file inside instead of popping dialog. despite of the attachment word. George. Click to expand... That thought about old browsers has crossed my mind. SP1 for 5.5 has fixed that issue 7 years ago )
I found where my "believes" came fromhttp://support.microsoft.com/default.aspx/kb/267991 turned out IE 5.5 would open file inside instead of popping dialog. despite of the attachment word. George. Click to expand... That thought about old browsers has crossed my mind. SP1 for 5.5 has fixed that issue 7 years ago )