Windows Vista Forums
Vista Forums Home Join Vista Forums Windows 7 Forum Vista Tutorials Tags
Welcome to Windows Vista Forums. Our forum is dedicated to helping you find solutions with any problems, errors or issues you are experiencing with Windows Vista. The Vista forum also covers news and updates and has an extensive Windows Vista tutorial section that covers a wide range of tips and tricks.

Go Back   Vista Forums > Misc Newsgroups > .NET General

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

Reply
 
Old 04-04-2008   #1 (permalink)
The Great Pawn Hunter


 
 

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

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

My System SpecsSystem Spec
Old 04-04-2008   #2 (permalink)
Anthony Jones


 
 

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

"The Great Pawn Hunter" <manusfealy@xxxxxx> wrote in message
news:b2d34bad-4c83-4dc1-831d-845948c61b30@xxxxxx
Quote:

> 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


My System SpecsSystem Spec
Old 04-05-2008   #3 (permalink)
The Great Pawn Hunter


 
 

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

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
My System SpecsSystem Spec
Old 04-06-2008   #4 (permalink)
Anthony Jones


 
 

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

"The Great Pawn Hunter" <manusfealy@xxxxxx> wrote in message
news:6cb9233b-1116-4698-b3aa-a2a34ddb27cb@xxxxxx
Quote:

> 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


My System SpecsSystem Spec
Old 04-07-2008   #5 (permalink)
The Great Pawn Hunter


 
 

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

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
My System SpecsSystem Spec
Reply

Thread Tools


Similar Threads
Thread Forum
script to POST and open reponse in new window VB Script
Inherit from usercontrol - Object not set to instance of an object .NET General
datalist -- Object reference not set to an instance of an object. .NET General
Slow reponse from UNC paths. PowerShell
Adding canonical aliases for Compare-Object, Measure-Object, New-Object PowerShell


Vista Forums is an independent web site and has not been authorized,
sponsored, or otherwise approved by Microsoft Corporation.
"Windows Vista", the Start Orb, and related materials are trademarks of Microsoft Corp.
© Designer Media Ltd

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46