|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2001-05-27 15:14 UTC] plastoc at ifrance dot com
<? $fp = fopen("$url", "rb"); // read binary file
while (!feof($fp)) {
$img = fread($fp, 4096); }
fclose($fp);
$fp = fopen("$dest","w"); // save binary file
fputs($fp, "$img");
fclose($fp); ?>
Using Windows98 with EasyPHP 1.3, ALL characters ASCII(10) found in the file become ASCII(10) with a NEW LINE after !
But using another platform like unix (I tested the script at ovh.org), nothing changed.
I tried with the "r" and the "rb" argument in fopen but it didn't work.
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sun Nov 02 22:00:01 2025 UTC |
You need to open the destination file also in binary mode. $fp=fopen("$dest", "wb"); --Jani