|
|
|||||||||
|
|||||||||
|
|||||||||
| |
||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
Download dialog box prompt twice
Hi there,
I have a problem. I have dynamically generated an .rtf file in an asp page. This works OK. When the user hits a submit button, a file download dialog box is generated from the following code; 'Write FrontPage to User Defined Location Response.CacheControl = "no-cache" Response.Expires = -1 Response.ContentType = "application/msword" Response.AddHeader "content-disposition","attachment; filename=filename.rtf" Response.write(pageStr) Response.end The dialog box is generated. When you 'open' the file, however, under OfficeXP the dialog box is generated twice. MS Word then generates an error message to say that the file could not be found in the temporary directory; C:\Documents and Settings\<userid>\Local Settings\Temporary Internet Files\Content.IE5\G9M30H6N The file is present in this location, and can be successfully launched from there by MS Word XP. This code works fine when using Office 2000, however, I cannot use Office2000 as OfficeXP is the major suite used in the environment for this page. You can save the file to a user defined location OK. I think that the problem is with MS Word XP, and how it is opened from the asp page, but am not sure. Does anyone have any idea what is going on, and more importantly how do I fix it. Thanks in advance for your help. Stanage. |
|
#2
|
|||
|
|||
|
Hi All,
I have figured out what is happening. When I use the above code, the client machine is prompted to download the dynamically generated file (first download dialog box) from the server, MS Word on the client is then lauched, Word then asks what to do with the file - hence a second download dialog box. As I was doing most of the development on a really fast machine/network I didn't notice the file dialog that is generated (the dialog boxes overlay each other so look like one!). As far as I can see there is no way around this problem. If anyone knows anything better then please let me know. Stanage. PS. This thread can be closed. |
|
#3
|
|||
|
|||
|
Glad you got it sorted!
__________________
|
|
#4
|
|||
|
|||
|
Just without attachment
If you put the same http header, without attachment, it will ask you only once:
Response.AddHeader("Content-Disposition", "filename=aaa.zip"); ![]() |
![]() |
| Viewing: ASP Free Forums > Other > ASP Free Lounge > Download dialog box prompt twice |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|