ASP Free Lounge
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
 
User Name:
Password:
Remember me
Go Back   ASP Free ForumsOtherASP Free Lounge

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread ASP Free Forums Sponsor:
  #1  
Old April 16th, 2004, 08:35 AM
stanage stanage is offline
Registered User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Apr 2004
Posts: 2 stanage User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
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.

Reply With Quote
  #2  
Old April 20th, 2004, 10:54 AM
stanage stanage is offline
Registered User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Apr 2004
Posts: 2 stanage User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
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.

Reply With Quote
  #3  
Old April 21st, 2004, 12:51 PM
Matrix28 Matrix28 is offline
Contributing User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Oct 2003
Posts: 51 Matrix28 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 45 sec
Reputation Power: 6
Cool

Glad you got it sorted!

Reply With Quote
  #4  
Old February 15th, 2005, 04:27 PM
homerti homerti is offline
Registered User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Feb 2005
Posts: 1 homerti User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 2 m 24 sec
Reputation Power: 0
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");


Reply With Quote
Reply

Viewing: ASP Free ForumsOtherASP Free Lounge > Download dialog box prompt twice


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 2 hosted by Hostway
Stay green...Green IT