Re: How do I force a 'Save Window?'
To force the save window is easy - make up your own content subtype (main type application) and set it: Content-Type: application/x-download-this-file-you-stupid-browser Remember to start with an x- as your type is obviously not registered with the IANA. The tricky part is setting up the default file name - if your script is http://foo.com/cgi-bin/download.pl?filename=bar the save dialog will default to download.pl; not to the expected bar. The solution is to force the file name out of the query string. You want to create a URI that looks like http://foo.com/download/bar?param1=val1param2=val2 or even better: http://foo.com/download/val1/val2/bar You should use mod_rewrite to take requests of this scheme and translate it to http://foo.com/cgi-bin/download.pl?filename=barparam1=val1param2=val2... The magic is that you then tell mod_rewrite to trigger an INTERNAL redirect, so the server works flawlessly without any funny configurations and the browser never sees it. If you're using a mod_perl handler, another way to do it is set up a location /download that calls your handler and read the filename (and possibly the parameters) directly out of the URI using the request object, but that's a bit harder (although more elegant and probably uses less resources then the big mighty mod_rewrite's rewrite engine). Issac - Original Message - From: Dennis Daupert [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Wednesday, November 20, 2002 1:02 AM Subject: How do I force a 'Save Window?' I have file upload working, can upload files of ascii or binary format. But a problem when you browse to a page that dynamically displays hyperlinks to files. Text and html files display normally in a browser, and Word docs popup MS Word as a helper app, and the word doc opens fine. But MS Project files popup a browser instance and MS Project, and you get the usual Enable macros and such popups as normal, but only a subset of the project displays in the browser window, and none of the buttons are active in the Project application. Bummer. How can I force a Save File dialog screen for selected files, so the user will have the option to download the file, then open it in Project or whatever? Thanks for any help or information. /dennis -- - Office phone: 817-762-8304 -- - Great leaders never tell people how to do their jobs. Great leaders tell people what to do and establish a framework within which it must be done. Then they let people on the front lines, who know best, figure out how to get it done. ~ General H. Norman Schwarzkopf
Re: How do I force a 'Save Window?'
On Wed, Nov 20, 2002 at 11:24:33AM +0200, Issac Goldstand wrote: To force the save window is easy - make up your own content subtype (main type application) and set it: Content-Type: application/x-download-this-file-you-stupid-browser Remember to start with an x- as your type is obviously not registered with the IANA. Why not use the application/octet-stream MIME type as recommended in RFC 1521? Tom
Re: How do I force a 'Save Window?'
Becuase some browsers and mail clients don't follow the RFC. The RFC clearly states that When a mail reader encounters mail with an unknown Content-type value, it should generally treat it as equivalent to 'application/octet-stream' (SECTION 4 last paragraph - page 12) So my suggestion should actually translate into application/octet-stream. However, I've noted that where many browsers do all sorts of strange, interesting, and usually unexepcted things when it parses application/octet-stream, they'll usually do exactly what you want if you confuse them with a type that they've certainly never heard of. Issac - Original Message - From: Tom Hukins [EMAIL PROTECTED] To: Issac Goldstand [EMAIL PROTECTED] Cc: Dennis Daupert [EMAIL PROTECTED]; [EMAIL PROTECTED] Sent: Wednesday, November 20, 2002 12:27 PM Subject: Re: How do I force a 'Save Window?' On Wed, Nov 20, 2002 at 11:24:33AM +0200, Issac Goldstand wrote: To force the save window is easy - make up your own content subtype (main type application) and set it: Content-Type: application/x-download-this-file-you-stupid-browser Remember to start with an x- as your type is obviously not registered with the IANA. Why not use the application/octet-stream MIME type as recommended in RFC 1521? Tom
Re: How do I force a 'Save Window?'
Thanks all for the great suggestions. This group is wonderfully helpful. I tried the quick route, setting MIME type to application/octet-stream, and that works fine for xl spreadsheets, but I still get the same behavior as before with MS Project files (browser IE 5.00.3105.0106, which is one of the IE versions we have to support). I will need a bit more time to try some of the other more involved ideas , so that won't be for a few more days. /dennis --- Office phone: 817-762-8304 --- Great leaders never tell people how to do their jobs. Great leaders tell people what to do and establish a framework within which it must be done. Then they let people on the front lines, who know best, figure out how to get it done. ~ General H. Norman Schwarzkopf
Re: How do I force a 'Save Window?'
Dennis, Microsoft has documentation on how IE handles MIME types, content-disposition headers, etc. It may be out of date, and not accurate, but it's certainly worth reading. Have a look at: http://msdn.microsoft.com/workshop/networking/moniker/overview/appendix_a.as p There is also a support webcast with more information: http://support.microsoft.com/default.aspx?scid=/servicedesks/webcasts/wc0111 01/wcblurb011101.asp In either document you'll see that application/octet-stream does not force a save window because IE classifies it as an ambiguous type. Note that you can always tell your users to right-click on the link and select Save Target As... to get a save window. Francisco [EMAIL PROTECTED] - Original Message - From: Dennis Daupert [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Wednesday, November 20, 2002 7:10 AM Subject: Re: How do I force a 'Save Window?' Thanks all for the great suggestions. This group is wonderfully helpful. I tried the quick route, setting MIME type to application/octet-stream, and that works fine for xl spreadsheets, but I still get the same behavior as before with MS Project files (browser IE 5.00.3105.0106, which is one of the IE versions we have to support). I will need a bit more time to try some of the other more involved ideas , so that won't be for a few more days. /dennis -- - Office phone: 817-762-8304 -- - Great leaders never tell people how to do their jobs. Great leaders tell people what to do and establish a framework within which it must be done. Then they let people on the front lines, who know best, figure out how to get it done. ~ General H. Norman Schwarzkopf
Re: How do I force a 'Save Window?'
I clicked on the links I sent in my previous message and noticed that one of them didn't work because my mail program had split the url into two pieces at a line boundary. You may have to cut and paste the two pieces into your browser's URL box. You can also look for the documents by their titles in Google. The titles are Appendix A: MIME Type Detection in Internet Explorer and MIME Type Handling in Internet Explorer. Francisco [EMAIL PROTECTED] - Original Message - From: Francisco Corella [EMAIL PROTECTED] To: [EMAIL PROTECTED]; Dennis Daupert [EMAIL PROTECTED] Sent: Wednesday, November 20, 2002 9:21 AM Subject: Re: How do I force a 'Save Window?' Dennis, Microsoft has documentation on how IE handles MIME types, content-disposition headers, etc. It may be out of date, and not accurate, but it's certainly worth reading. Have a look at: http://msdn.microsoft.com/workshop/networking/moniker/overview/appendix_a.as p There is also a support webcast with more information: http://support.microsoft.com/default.aspx?scid=/servicedesks/webcasts/wc0111 01/wcblurb011101.asp In either document you'll see that application/octet-stream does not force a save window because IE classifies it as an ambiguous type. Note that you can always tell your users to right-click on the link and select Save Target As... to get a save window. Francisco [EMAIL PROTECTED] - Original Message - From: Dennis Daupert [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Wednesday, November 20, 2002 7:10 AM Subject: Re: How do I force a 'Save Window?' Thanks all for the great suggestions. This group is wonderfully helpful. I tried the quick route, setting MIME type to application/octet-stream, and that works fine for xl spreadsheets, but I still get the same behavior as before with MS Project files (browser IE 5.00.3105.0106, which is one of the IE versions we have to support). I will need a bit more time to try some of the other more involved ideas , so that won't be for a few more days. /dennis -- - Office phone: 817-762-8304 -- - Great leaders never tell people how to do their jobs. Great leaders tell people what to do and establish a framework within which it must be done. Then they let people on the front lines, who know best, figure out how to get it done. ~ General H. Norman Schwarzkopf
Re: How do I force a 'Save Window?'
This works for me: I'm using pdf stuff here, but you can set the content type to whatever you want. $r-content_type('application/pdf');$r-header_out("Content-Disposition" = "attachment; filename=order.pdf");$r-send_http_header(); Marc Slagle - Original Message - From: "Dennis Daupert" [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Wednesday, November 20, 2002 10:10 AM Subject: Re: How do I force a 'Save Window?' Thanks all for the great suggestions. This group is wonderfully helpful. I tried the quick route, setting MIME type to "application/octet-stream," and that works fine for xl spreadsheets, but I still get the same behavior as before with MS Project files (browser IE 5.00.3105.0106, which is one of the IE versions we have to support). I will need a bit more time to try some of the other more involved ideas , so that won't be for a few more days. /dennis --- Office phone: 817-762-8304 --- "Great leaders never tell people how to do their jobs. Great leaders tell people what to do and establish a framework within which it must be done. Then they let people on the front lines, who know best, figure out how to get it done." ~ General H. Norman Schwarzkopf
Re: How do I force a 'Save Window?'
Bonus Points : Use Content-Disposition: attachment;filename=blabla and pre-set the name of the file on disk. I tried it hard (in my case I generate PDF files. No way. Internet Explorer ignored it. Finally I decided to perform redirect to URL ending with /blabla.pdf - then it worked more-or-less as expected. -- ( Marcin Kasperski | A reusable framework that is developed by itself will ) ( http://www.mk.w.pl |probably not be very reusable. (Martin)) () ( Porady dla twrcw serwisw WWW: http://www.mk.w.pl/porady/porady_www )
Re: How do I force a 'Save Window?'
I guess its a your mileage may vary sort of thing. The marketing folks here use XP and whatever IE comes with it. I send $r-content_type( 'application/vnd.ms-excel' ) ; $r-header_out('Content-Disposition' = 'attachment; filename=report.xls' ) ; #$r-content_type( 'application/octet-stream' ) ; $r-send_http_header; and for their XP boxes it opens properly in browser ( same for project ). They are posting to index.html in this case but get the filename properly. On my mac os x I actually get a file named 'report.xls' in my save dialog. So, as often is the case, Your Mileage May Vary :) John- On 20 Nov 2002 22:00:25 +0100 Marcin Kasperski [EMAIL PROTECTED] wrote: Bonus Points : Use Content-Disposition: attachment;filename=blabla and pre-set the name of the file on disk. I tried it hard (in my case I generate PDF files. No way. Internet Explorer ignored it. Finally I decided to perform redirect to URL ending with /blabla.pdf - then it worked more-or-less as expected. -- ( Marcin Kasperski | A reusable framework that is developed by itself will ) ( http://www.mk.w.pl |probably not be very reusable. (Martin)) () ( Porady dla twrcw serwisw WWW: http://www.mk.w.pl/porady/porady_www )
How do I force a 'Save Window?'
I have file upload working, can upload files of ascii or binary format. But a problem when you browse to a page that dynamically displays hyperlinks to files. Text and html files display normally in a browser, and Word docs popup MS Word as a helper app, and the word doc opens fine. But MS Project files popup a browser instance and MS Project, and you get the usual Enable macros and such popups as normal, but only a subset of the project displays in the browser window, and none of the buttons are active in the Project application. Bummer. How can I force a Save File dialog screen for selected files, so the user will have the option to download the file, then open it in Project or whatever? Thanks for any help or information. /dennis --- Office phone: 817-762-8304 --- Great leaders never tell people how to do their jobs. Great leaders tell people what to do and establish a framework within which it must be done. Then they let people on the front lines, who know best, figure out how to get it done. ~ General H. Norman Schwarzkopf
Re: How do I force a 'Save Window?'
You can always set the content type to application/octet-steam but I wouldn't expect IE to honor the content type. Regards, Tim Tompkins -- Programmer http://www.clipart.com/ http://www.rebelartist.com/ -- - Original Message - From: Dennis Daupert [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Tuesday, November 19, 2002 4:02 PM Subject: How do I force a 'Save Window?' I have file upload working, can upload files of ascii or binary format. But a problem when you browse to a page that dynamically displays hyperlinks to files. Text and html files display normally in a browser, and Word docs popup MS Word as a helper app, and the word doc opens fine. But MS Project files popup a browser instance and MS Project, and you get the usual Enable macros and such popups as normal, but only a subset of the project displays in the browser window, and none of the buttons are active in the Project application. Bummer. How can I force a Save File dialog screen for selected files, so the user will have the option to download the file, then open it in Project or whatever? Thanks for any help or information. /dennis -- - Office phone: 817-762-8304 -- - Great leaders never tell people how to do their jobs. Great leaders tell people what to do and establish a framework within which it must be done. Then they let people on the front lines, who know best, figure out how to get it done. ~ General H. Norman Schwarzkopf
Re: How do I force a 'Save Window?'
That should be stream not steam :) Regards, Tim Tompkins -- Programmer http://www.clipart.com/ http://www.rebelartist.com/ -- - Original Message - From: Tim Tompkins [EMAIL PROTECTED] To: [EMAIL PROTECTED]; Dennis Daupert [EMAIL PROTECTED] Sent: Tuesday, November 19, 2002 4:27 PM Subject: Re: How do I force a 'Save Window?' You can always set the content type to application/octet-steam but I wouldn't expect IE to honor the content type. Regards, Tim Tompkins -- Programmer http://www.clipart.com/ http://www.rebelartist.com/ -- - Original Message - From: Dennis Daupert [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Tuesday, November 19, 2002 4:02 PM Subject: How do I force a 'Save Window?' I have file upload working, can upload files of ascii or binary format. But a problem when you browse to a page that dynamically displays hyperlinks to files. Text and html files display normally in a browser, and Word docs popup MS Word as a helper app, and the word doc opens fine. But MS Project files popup a browser instance and MS Project, and you get the usual Enable macros and such popups as normal, but only a subset of the project displays in the browser window, and none of the buttons are active in the Project application. Bummer. How can I force a Save File dialog screen for selected files, so the user will have the option to download the file, then open it in Project or whatever? Thanks for any help or information. /dennis -- - Office phone: 817-762-8304 -- - Great leaders never tell people how to do their jobs. Great leaders tell people what to do and establish a framework within which it must be done. Then they let people on the front lines, who know best, figure out how to get it done. ~ General H. Norman Schwarzkopf
Re: How do I force a 'Save Window?'
Quick google search shows : http://www.utoronto.ca/webdocs/HTMLdocs/Book/Book-3ed/appb/mimetype.html Send the mime type as : application/vnd.ms-project I do this with excel using application/vnd.ms-excel and the marketing folks love it. So, you would have to provide a link to your modperl app that opens the file and pushes it out with this content type. Bonus Points : Use Content-Disposition: attachment;filename=blabla and pre-set the name of the file on disk. John- John- On Tue, 19 Nov 2002 16:27:33 -0700 Tim Tompkins [EMAIL PROTECTED] wrote: You can always set the content type to application/octet-steam but I wouldn't expect IE to honor the content type. Regards, Tim Tompkins -- Programmer http://www.clipart.com/ http://www.rebelartist.com/ -- - Original Message - From: Dennis Daupert [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Tuesday, November 19, 2002 4:02 PM Subject: How do I force a 'Save Window?' I have file upload working, can upload files of ascii or binary format. But a problem when you browse to a page that dynamically displays hyperlinks to files. Text and html files display normally in a browser, and Word docs popup MS Word as a helper app, and the word doc opens fine. But MS Project files popup a browser instance and MS Project, and you get the usual Enable macros and such popups as normal, but only a subset of the project displays in the browser window, and none of the buttons are active in the Project application. Bummer. How can I force a Save File dialog screen for selected files, so the user will have the option to download the file, then open it in Project or whatever? Thanks for any help or information. /dennis -- - Office phone: 817-762-8304 -- - Great leaders never tell people how to do their jobs. Great leaders tell people what to do and establish a framework within which it must be done. Then they let people on the front lines, who know best, figure out how to get it done. ~ General H. Norman Schwarzkopf
Re: How do I force a 'Save Window?'
For IE 5.5, IE doesn't respect the Content-Disposition header and will prompt the user to save a file as foo.pl (or whatever the name of your script happens to be) M$ claims that this was fixed in IE 5.5 SP1. They document this bug (as fixed) here: http://support.microsoft.com/default.aspx?scid=kb;EN-US;267991 -kb [EMAIL PROTECTED] wrote: Quick google search shows : http://www.utoronto.ca/webdocs/HTMLdocs/Book/Book-3ed/appb/mimetype.html Send the mime type as : application/vnd.ms-project I do this with excel using application/vnd.ms-excel and the marketing folks love it. So, you would have to provide a link to your modperl app that opens the file and pushes it out with this content type. Bonus Points : Use Content-Disposition: attachment;filename=blabla and pre-set the name of the file on disk. John- John- On Tue, 19 Nov 2002 16:27:33 -0700 Tim Tompkins wrote: You can always set the content type to application/octet-steam but I wouldn't expect IE to honor the content type. Regards, Tim Tompkins -- Programmer http://www.clipart.com/ http://www.rebelartist.com/ -- - Original Message - From: Dennis Daupert To: Sent: Tuesday, November 19, 2002 4:02 PM Subject: How do I force a 'Save Window?' I have file upload working, can upload files of ascii or binary format. But a problem when you browse to a page that dynamically displays hyperlinks to files. Text and html files display normally in a browser, and Word docs popup MS Word as a helper app, and the word doc opens fine. But MS Project files popup a browser instance and MS Project, and you get the usual Enable macros and such popups as normal, but only a subset of the project displays in the browser window, and none of the buttons are active in the Project application. Bummer. How can I force a Save File dialog screen for selected files, so the user will have the option to download the file, then open it in Project or whatever? Thanks for any help or information. /dennis -- - Office phone: 817-762-8304 -- - Great leaders never tell people how to do their jobs. Great leaders tell people what to do and establish a framework within which it must be done. Then they let people on the front lines, who know best, figure out how to get it done. ~ General H. Norman Schwarzkopf -- Kevin Berggren760-480-1828 System Maker, Inc 3913 Sierra Linda Dr. Escondido, CA 92025