How do I put a saveto name from a reponse object .net
How do I put a saveto name from a reponse object .net
am 04.04.2008 21:50:38 von The Great Pawn Hunter
Hi,
I want to write a reponse .aspx web application to dump a word
document to the browser. I am finding that the browser plugin for
microsoft word puts the url that the javascript window.open(url)
command uses to execute the responsdoc.aspx application on the server.
(responsedoc.aspx writes the word document to the reponse stream) I
do not want to put this url into the save to field in the word plugin
but want an actual file name to be in that save to box.
Does anyone know how to do this?
Manny
Re: How do I put a saveto name from a reponse object .net
am 04.04.2008 22:12:19 von Anthony Jones
"The Great Pawn Hunter" wrote in message
news:b2d34bad-4c83-4dc1-831d-845948c61b30@t54g2000hsg.google groups.com...
> Hi,
> I want to write a reponse .aspx web application to dump a word
> document to the browser. I am finding that the browser plugin for
> microsoft word puts the url that the javascript window.open(url)
> command uses to execute the responsdoc.aspx application on the server.
> (responsedoc.aspx writes the word document to the reponse stream) I
> do not want to put this url into the save to field in the word plugin
> but want an actual file name to be in that save to box.
>
> Does anyone know how to do this?
>
Try:-
Response.AddHeader("Content-Disposition", "filename=MyFile.doc")
The save dialog should show MyFile.doc.
You can force the save dialog (IOW make it appear to be a download) with:-
Response.AddHeader("Content-Disposition", "filename=MyFile.doc; attachment")
--
Anthony Jones - MVP ASP/ASP.NET
Re: How do I put a saveto name from a reponse object .net
am 05.04.2008 16:32:51 von The Great Pawn Hunter
Yes, your first suggestion we tried already but it doesn't put the
filename into the save to box. However, your second suggests works
great. We are using IE 6.0. We noticed that on IE7 with word 2003
your first suggestion works great. However, there seems to be an
issue with word 2000 on IE 6.
Manny
Re: How do I put a saveto name from a reponse object .net
am 06.04.2008 22:16:28 von Anthony Jones
"The Great Pawn Hunter" wrote in message
news:6cb9233b-1116-4698-b3aa-a2a34ddb27cb@u69g2000hse.google groups.com...
> Yes, your first suggestion we tried already but it doesn't put the
> filename into the save to box. However, your second suggests works
> great. We are using IE 6.0. We noticed that on IE7 with word 2003
> your first suggestion works great. However, there seems to be an
> issue with word 2000 on IE 6.
Have you tried Word 2000 hosted in IE7 or Word 2003 hosted in IE6?
--
Anthony Jones - MVP ASP/ASP.NET
Re: How do I put a saveto name from a reponse object .net
am 07.04.2008 17:35:09 von The Great Pawn Hunter
Hi Anthony,
It appears that when you provide the attach keyword there is a side
effect of opening a blank window and the new document. I do not want
to replace the original window so it appears that using _self on the
window is out of the question...all I want to do is open the word
document in a new window and have a save to field with myfile.doc in
it.
manny