Re: problems with fread and binary info
| From: | O. | Date: | Wed, 19 Jul 2000 22:54:29 +0000 |
| Subject: | Re: problems with fread and binary info | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-7351@lists.php.net to get a copy of this message | ||
"Joel Schopp" <spiffy@babel.acu.edu> wrote in message
news:Pine.LNX.4.10.10007191615410.1582-100000@babel.acu.edu...
> I am using php4pl2. I am using the cgi version with apache. I have found
> I am not alone in problems related to pulling graphics off of webpages and
> trying to store them locally. I just haven't found a workaround.
<snip>
> <?php
> header("Content-type: image/gif");
> $image_file =
fopen("http://images.amazon.com/images/P/0070131430.01.MZZZZZZZ.gif",'rb');
> $image_data = fread($image_file,-1);
> echo $image_data;
> ?>
Try using stripslashes($image_data) or stripcslashes($image_data) . In my
limited experience with binary data, I've noted that PHP inserts \'s in
front of things like quotes; I'm not sure whether it does this while storing
data or printing data or both.
http://www.php.net/manual/function.stripslashes.php
http://www.php.net/manual/function.stripcslashes.php
--
O.