On Saturday 07 December 2002 05:12, Jeremiah Breindel wrote:
> I am trying to save a dynamically generated image on an outside server to a
> local file on my server using the code below:
>
>  $fc = fopen($image_filename, "wb");
>  $file = fopen ($image_url, "rb");
>
>  if (!$file) {
>   echo "<p>Unable to open remote file.\n";
>   exit;
>  }else{
>   while (!feof ($file)) {
>    $line = fread ($file, 1028);
>    fwrite($fc,$line);
>   }
>  }
>  fclose($fc);
>         fclose($file);
>
>
> $image_filename is a locally referred to file, such as
> "../images/file1.png" and $image_url is an absolute address, such as
> "http://www.whatever.com/imagecreate.php";.
>
> Instead of saving when I run the script through a browser, the image
> displays within the browser, and the script creates a file containing only
> "427" on the server.  Any ideas why or what I can do to correct this?

Hmm, I don't see how the above code can make the remote image *display* your 
browser. The code itself looks OK, are there some parts of the code that you 
haven't shown us? 

If the above is indeed your complete code, then what is your $image_url?

-- 
Jason Wong -> Gremlins Associates -> www.gremlins.biz
Open Source Software Systems Integrators
* Web Design & Hosting * Internet & Intranet Applications Development *

/*
Things will be bright in P.M.  A cop will shine a light in your face.
*/


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

Reply via email to