Because when I didn't stripslashes I got a blank image...

--TWB

----- Original Message -----
From: "Frank M. Kromann" <[EMAIL PROTECTED]>
To: "Thomas W. Badera" <[EMAIL PROTECTED]>
Sent: Wednesday, March 28, 2001 12:13 PM
Subject: Re: [PHP-WIN] PHP and Filesystem


> Why are you striping slasches ? I would just read the file and save them
to disk.
>
> - Frank
>
> > Another question....
> >
> > I've got a script that is supposed to read URLs out of a text file, open
the
> > image at the URL, then copy it to the local computer.  The code follows:
> >
> > <?php
> >
> > $input = fopen("d:\\webs\\sportspotonline.com\\data\\images.txt", "r");
> > while (!feof($input))
> > {
> >  $buffer = trim(fgets($input, 4096));
> >  if ($buffer != "Navigation")
> >  {
> >   $fnArray = explode("/", $buffer);
> >   $fn = $fnArray[sizeof($fnArray)-1];
> >   $fn = "d:\\webs\\sportspotonline.com\\data\\images\\".$fn;
> >   $output = fopen($fn, "wb");
> >   $grab = fopen($buffer, "rb");
> >   while ($grabbed = fread($grab, 4096);)
> >   {
> >    $grabbed = stripslashes($grabbed);
> >    fwrite($output, $grabbed, strlen($grabbed));
> >   }
> >   fclose($output);
> >   fclose($grab);
> >  }
> > }
> > fclose($input);
> >
> > ?>
> >
> > The images this saves are all corrupt.... openable, partially viewable,
but
> > corrupt.  Any idea?
> >
> > --TWB
> >
> >
> > ---
> > Thomas W. Badera
> > WebTeam Manager
> > Clarkson University
> > < [EMAIL PROTECTED] >
> >
> >
> >
> > --
> > PHP Windows Mailing List (http://www.php.net/)
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> > To contact the list administrators, e-mail: [EMAIL PROTECTED]
> >
> >
> >
>
>
>


-- 
PHP Windows Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to