Re: [PHP] Re: Change in 5.2.1 re. parsing of URL

2007-02-20 Thread Lewis Kapell
We are already using the Content-type header (I should have mentioned 
that in my first message).  And to say that the user's browser is 
misconfigured is no solution, since we don't have the ability to 
reconfigure it.  If all of our users were on a local network there would 
be no problem.  But that's not our situation.


Thank you,

Lewis Kapell
Computer Operations
Seton Home Study School


Fergus Gibson wrote:

Lewis Kapell wrote:

http://www.mydomain.com/mypage.php/phonypage.pdf

In this example there is a PHP script called mypage.php which serves
up a PDF.  Putting the extra text at the end of the URL makes it
appear to the user's browser that the URL ends with '.pdf' rather
than '.php'.  We introduced this hack at my company because a few
users were unable to view pages containing PDF or RTF content,
presumably because of some combination of browser and/or firewall
settings.


This is the proper way to handle this.  If it doesn't work, the user's
browser is misconfigured.

?php
header('Content-type: application/pdf');
// your PDF data
?



--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Re: Change in 5.2.1 re. parsing of URL

2007-02-20 Thread Lewis Kapell


Fergus Gibson wrote:

Lewis Kapell wrote:

We are already using the Content-type header (I should have mentioned
 that in my first message).


Hmmm.  So you have a PHP script that sets the mimetype correctly and
then outputs straight PDF data, but the user's browser does not accept
it as a PDF because the extension of the script is PHP?  I find that
strange.


It's rare but it does happen.  We suspect it's a behavior exhibited by 
certain browsers in combination with certain firewall settings, or 
something like that.




If you can't find a better solution (something weird is going on in my
mind) maybe a work-around is mod_rewrite?  You could link to the PHP
script with a PDF extension and then rewrite it to the PHP extension
behind the scenes.


I'll look into that.  Thanks for the tip.

- Lewis

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] Change in 5.2.1 re. parsing of URL

2007-02-19 Thread Lewis Kapell
There seems to be a behavior change introduced in 5.2.1 and I would like 
to know if it was deliberate.


A couple of years ago, PHP introduced functionality that made it 
possible to use a certain trick.  I don't know how to describe this 
trick in words, so I will illustrate with an example.


http://www.mydomain.com/mypage.php/phonypage.pdf

In this example there is a PHP script called mypage.php which serves up 
a PDF.  Putting the extra text at the end of the URL makes it appear to 
the user's browser that the URL ends with '.pdf' rather than '.php'.  We 
introduced this hack at my company because a few users were unable to 
view pages containing PDF or RTF content, presumably because of some 
combination of browser and/or firewall settings.


I find that version 5.2.1 breaks this behavior - attempting to visit a 
URL such as the above produces a 'page not found' error.  Presumably 
because it is trying to find the file 'phonypage.pdf' which doesn't exist.


My question is, should this be regarded as a bug which might be fixed? 
Or is this a deliberate change of behavior?


--

Thank you,

Lewis Kapell
Computer Operations
Seton Home Study School

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Change in 5.2.1 re. parsing of URL

2007-02-19 Thread Lewis Kapell
If this has nothing to do with PHP, maybe you can explain why the 
behavior was broken when I upgraded from 5.2.0 to 5.2.1, and started 
working again the instant I reverted back to 5.2.0.  No other 
configuration changes were made on the web server.


??

Thank you,

Lewis Kapell
Computer Operations
Seton Home Study School


Jochem Maas wrote:

Lewis Kapell wrote:

There seems to be a behavior change introduced in 5.2.1 and I would like
to know if it was deliberate.


[snip]


this is nothing to do with php - it's down to your webserver settings.




--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php