|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2001-03-17 06:51 UTC] leonardo at pcnet dot ro
I have two web servers with Windows 2000 running on them. One of them uses as a web server Microsoft IIS and the other one Apache 1.3.19 for Windows. I have a php script which connects to a remote web server and grabs an image. The image is written on a file (with fwrite function) and saved on the local harddisk. If I run the php script on IIS the image is saved correctly. If I run the php script on Apache the image is corrupted (has a larger length in bytes; usually, between 1-50 bytes). PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Fri Oct 24 19:00:01 2025 UTC |
Thank you Jani! This is the code: if($fd_url = fopen("http://www.some_site.com/some_picture.jpg", "r")) { $fd_img = fopen("c:\\some_picture.jpg", "w"); while (!feof($fd_url)) { $buffer = fread($fd_url, 4096); fwrite($fd_img, $buffer, strlen(buffer)); } fclose($fd_img); fclose($fd_url); }