How do I put a saveto name from a reponse object .net

  • Thread starter The Great Pawn Hunter
  • Start date
T

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
 
A

Anthony Jones

The Great Pawn Hunter said:
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")
 
T

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
 
A

Anthony Jones

The Great Pawn Hunter said:
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?
 
T

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top