RE: [OT] Content-Disposition to change type and action?

2001-06-06 Thread Geoffrey Young



 -Original Message-
 From: Wilt, Paul [mailto:[EMAIL PROTECTED]]
 Sent: Wednesday, May 30, 2001 9:52 AM
 To: 'Ged Haywood'; Issac Goldstand
 Cc: [EMAIL PROTECTED]
 Subject: RE: [OT] Content-Disposition to change type and action?
 

sorry I'm getting to this thread a bit late...

in case anyone is interested, this looks like the general microsoft stance -

http://support.microsoft.com/support/kb/articles/Q258/4/52.ASP

as an aside, I found this patch one day, which allows MSIE to do the right
thing for text/plain (albeit only if the EU changes his registry settings,
but since I run lots of tests with text/plain it was helpful...)

http://support.microsoft.com/support/kb/articles/Q239/7/50.ASP

and while looking for that reference for this post, I stumbled upon this

http://support.microsoft.com/support/kb/articles/Q160/0/13.asp

yuk...

--Geoff



Re: Content-Disposition to change type and action?

2001-06-06 Thread Kee Hinckley

-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

At 4:41 PM -0700 5/29/01, John Jung wrote:
more details.)  To get around IE5's funky behavior just defined a custom MIME
type outside the MS hardcoded stuff.

Not really sufficient.  IE will completely ignore mime types and go 
with its own guess as to the type.  It's even possible to persuade it 
that a JPEG is an HTML file by embedding some HTML in the comment 
field.  You need to blank-fill the beginning of a file if you want to 
avoid this--assuming of course that the file type you are trying to 
use supports something like that.
- -- 

Kee Hinckley - Somewhere.Com, LLC
http://consulting.somewhere.com/

I'm not sure which upsets me more: that people are so unwilling to accept
responsibility for their own actions, or that they are so eager to regulate
everyone else's.

-BEGIN PGP SIGNATURE-
Version: PGPfreeware 7.0.3 for non-commercial use http://www.pgp.com

iQA/AwUBOx5EcCZsPfdw+r2CEQJGmQCg0EJCRX7QFRGvefLfcofRkBVdmLgAoJpV
Gx7kqz3wtTi3eg6NhW+dQNXd
=gwGE
-END PGP SIGNATURE-



Re: Content-Disposition to change type and action?

2001-05-31 Thread Issac Goldstand



 Hi there,

 On Tue, 29 May 2001, Jay Jacobs wrote:

I've tried setting $r-content_type and even $r-filename to try and
get
  the browser (ie 5 for now) to see it as a non-html file and do the
  right thing.

 IE is particularly fond of ignoring Content-type.  If the file is called
 something.html or something.htm I've found IE will treat it as html even
 if you say it's text/plain in Content-type.  Ugh.

no - that only happens when you supply text/* (and possibly image/*).  I've
had reasons to force internet explorer to do what I want (down, boy! :-) )
and after a bit of hassle, I usually can just by setting the content-type in
a way it likes (which is uslally compatible with the other browsers, too).

  Issac






RE: [OT] Content-Disposition to change type and action?

2001-05-31 Thread Rafiq Ismail

 
 On Wed, 30 May 2001, Ged Haywood wrote:
 On Wed, 30 May 2001, Issac Goldstand wrote:
 
   Ged wrote:
IE is particularly fond of ignoring Content-type.  If the file is
 called
something.html or something.htm I've found IE will treat it as html
 even
if you say it's text/plain in Content-type.  Ugh.
 
 added a fake parameter of like ie=x.pdf to the end of the URL IE3 would
 refuse


Just to confirm this - I've recently had the same experience with ie5/mac
calling a real media file delivered through cgi.  Had to use the same
?...fakeparam=.rm cop-out.

I'm sure Microsoft probably see this a feature though.  Just like they've
always see their blue screen of death as a feature.  

R.




-- 
Rafiq Ismail

Software Engineer and Systems Administrator
http://www.codix.net


All the best people in life seem to like Linux. - Steve Wozniak







Re: [OT] Content-Disposition to change type and action?

2001-05-30 Thread Ged Haywood

Hi there,

On Wed, 30 May 2001, Issac Goldstand wrote:

 Ged wrote:
  IE is particularly fond of ignoring Content-type.  If the file is called
  something.html or something.htm I've found IE will treat it as html even
  if you say it's text/plain in Content-type.  Ugh.
 
 no - that only happens when you supply text/* (and possibly image/*).  I've
 had reasons to force internet explorer to do what I want (down, boy! :-) )
 and after a bit of hassle, I usually can just by setting the content-type in
 a way it likes (which is uslally compatible with the other browsers, too).

Sorry, I have to disagree.  I was so surprised when it happened I verified
it by snooping the network.  I'm not saying it's all versions, I think it
was 5.0 but I can't remember I'm afraid.  Was only a couple of months ago.

73,
Ged.





RE: [OT] Content-Disposition to change type and action?

2001-05-30 Thread Wilt, Paul


On Wed, 30 May 2001, Ged Haywood wrote:
On Wed, 30 May 2001, Issac Goldstand wrote:

  Ged wrote:
   IE is particularly fond of ignoring Content-type.  If the file is
called
   something.html or something.htm I've found IE will treat it as html
even
   if you say it's text/plain in Content-type.  Ugh.
  
  no - that only happens when you supply text/* (and possibly image/*).
I've
  had reasons to force internet explorer to do what I want (down, boy! :-)
)
  and after a bit of hassle, I usually can just by setting the
content-type in
  a way it likes (which is uslally compatible with the other browsers,
too).

 Sorry, I have to disagree.  I was so surprised when it happened I verified
 it by snooping the network.  I'm not saying it's all versions, I think it
 was 5.0 but I can't remember I'm afraid.  Was only a couple of months ago.

I have to agree with Ged.  IE3 browsers seemed to ignore the Content-Type
header
for PDF files.  Our system dynamically creates PDF files on request and
unless we
added a fake parameter of like ie=x.pdf to the end of the URL IE3 would
refuse
to load the file.  Most IE4 builds correctly interpreted the Content-Type
... and
then as soon as we began testing IE5 we noticed that the Microsoft ignorance
had
returned.  I have a friend who is a field engineer for Microsoft.  I sent a
bug
report through him to the Microsoft people and he basically ended up saying
(not
in these exact words) that they told him they had bigger fish to fry than to
correct this problem.

What a bummer!

Paul E Wilt 
Principal Software Engineer

XanEdu, Inc. ( a division of Bell+Howell InformationLearning)
http://www.XanEdu.com
mailto:[EMAIL PROTECTED]
mailto:[EMAIL PROTECTED]
300 North Zeeb Rd   Phone: (734) 975-6021  (800)
521-0600 x6021
Ann Arbor, MI 48106 Fax:(734) 973-0737





Content-Disposition to change type and action?

2001-05-29 Thread Jay Jacobs

I've got a form that will (should) send various formats back to the client
depending on form values.  They may want the results back in csv, pdf or
plain html.  The form always submits to a .html, and the browser usually
expects an html.

  I've tried setting $r-content_type and even $r-filename to try and get
the browser (ie 5 for now) to see it as a non-html file and do the
right thing.  Then I came across setting Content-Disposition:

$r-header_out(Content-Disposition,
attachment;filename=\ticket_search.csv\);

This has an unexpected result, I get a pop-up asking me what I want to do
with the html document (save/exec), if I exec it, it asks me what I want
to do with the csv (save/exec).  I've never run across
Content-Disposition, anyone have a listing of what it does and the
options?

How do other out there return other mime-types when text/html is
requested?

Jay




Re: Content-Disposition to change type and action?

2001-05-29 Thread Ged Haywood

Hi there,

On Tue, 29 May 2001, Jay Jacobs wrote:

   I've tried setting $r-content_type and even $r-filename to try and get
 the browser (ie 5 for now) to see it as a non-html file and do the
 right thing.

IE is particularly fond of ignoring Content-type.  If the file is called
something.html or something.htm I've found IE will treat it as html even
if you say it's text/plain in Content-type.  Ugh.

73,
Ged.





Re: Content-Disposition to change type and action?

2001-05-29 Thread Steve Piner



Jay Jacobs wrote:

 I've got a form that will (should) send various formats back to the client
 depending on form values.  They may want the results back in csv, pdf or
 plain html.  The form always submits to a .html, and the browser usually
 expects an html.

My suggestion is to use mod_rewrite to create a mapping so that the
actual file name doesn't matter. I have a rule in the Apache conf file:

RewriteRule ^/reports/ /bin/report.pl [PT]

So going to http://www.mysite.com/reports/foo.csv?param1=val1 would be
the same as going to http://www.mysite.com/bin/report.pl?param1=val1
except if the page is to be downloaded, the browser will use the name
foo.csv.

There's another parameter which gets passed to /reports/whatever.csv to
indicate that it should generate a csv, and send a suitable
Content-Type, but getting the 'name' right solves half the problem.

Steve

-- 
Steve Piner
Web Applications Developer
Marketview Limited
http://www.marketview.co.nz



Re: Content-Disposition to change type and action?

2001-05-29 Thread Steve Smith

Steve == Steve Piner [EMAIL PROTECTED] writes:
 So going to http://www.mysite.com/reports/foo.csv?param1=val1
 would be the same as going to
 http://www.mysite.com/bin/report.pl?param1=val1 except if the page
 is to be downloaded, the browser will use the name foo.csv.

This also works :

  http://www.mysite.com/bin/report.pl/foo.csv?param1=val1

report.pl gets called with param1=val1, but if you set the appropriate
Content-Type the browser prompt to save it to foo.csv.  Works in
Netscape and IE.

Of course, this is what Content-Disposition is *supposed* to do; ho hum.

Cheers,
Steve



Re: Content-Disposition to change type and action?

2001-05-29 Thread Bird Lei


$r-header_out(Content-Disposition,
attachment;filename=\ticket_search.csv\);

This has an unexpected result, I get a pop-up asking me what I want to do
with the html document (save/exec), if I exec it, it asks me what I want
to do with the csv (save/exec).  I've never run across
Content-Disposition, anyone have a listing of what it does and the
options?

I had this problem too.  However, what I got is the opposite.

2 cases.
First (file type is plain text):
I wanted the browser to pop up a windows for action (save/exec).  It got 
displayed on the browser window (IE5.5) instead of having a popup.  Seems 
if the file type is associated with the browser, it won't pop up the 
window.  However, there must be a way to get this as we want it to, right?

Case 2 (file type is Image.  gif or jpg):
I  just want to change the file name for an image that is retrieved through 
a perl script.  For example, if my script is called image.cgi, the file 
name, when being saved, will be image.cgi instead of the desired 
filename.  However, I ran into Jay's problem if I specify the 
Content-Disposition header.

Anyone knows a way to do this right?

Thanks.

Bird Lei




Re: Content-Disposition to change type and action?

2001-05-29 Thread Ken Williams

[EMAIL PROTECTED] (Steve Piner) wrote:
My suggestion is to use mod_rewrite to create a mapping so that the
actual file name doesn't matter. I have a rule in the Apache conf file:

RewriteRule ^/reports/ /bin/report.pl [PT]

So going to http://www.mysite.com/reports/foo.csv?param1=val1 would be
the same as going to http://www.mysite.com/bin/report.pl?param1=val1
except if the page is to be downloaded, the browser will use the name
foo.csv.

That doesn't solve the problem, though.  The type of file is chosen in a
form, and the action of the form is already set by the time that form is
loaded.  I assume Jay doesn't want to use Javascript to change the
action dynamically.

My own preference would be to post to some generic script which
redirects to another URL with the desired filename extension and proper
disposition headers.


  ------
  Ken Williams Last Bastion of Euclidity
  [EMAIL PROTECTED]The Math Forum



Re: Content-Disposition to change type and action?

2001-05-29 Thread Jay Jacobs

Ken's right and yeah, I wanted to stay away from Javascript and keep it
simple, it's not the doing of javascript that's bad, it's the redoing.

One thing that appears to work is setting the Content-Disposition header
value to inline;filename=\search.csv\. (instead of attachment).
IE5 seems to do the right thing with that, it pops up one box saying what
would like to do with search.csv?.  Doing a redir might be a better
option then to trust IE4 and NS+ to do it correctly... not to mention
trusting IE6 to do anything like IE5.

Thanks for the help,
Jay

On Tue, 29 May 2001, Ken Williams wrote:

 [EMAIL PROTECTED] (Steve Piner) wrote:
 My suggestion is to use mod_rewrite to create a mapping so that the
 actual file name doesn't matter. I have a rule in the Apache conf file:
 
 RewriteRule ^/reports/ /bin/report.pl [PT]
 
 So going to http://www.mysite.com/reports/foo.csv?param1=val1 would be
 the same as going to http://www.mysite.com/bin/report.pl?param1=val1
 except if the page is to be downloaded, the browser will use the name
 foo.csv.

 That doesn't solve the problem, though.  The type of file is chosen in a
 form, and the action of the form is already set by the time that form is
 loaded.  I assume Jay doesn't want to use Javascript to change the
 action dynamically.

 My own preference would be to post to some generic script which
 redirects to another URL with the desired filename extension and proper
 disposition headers.


   ------
   Ken Williams Last Bastion of Euclidity
   [EMAIL PROTECTED]The Math Forum