|
Posted by J.O. Aho on 12/09/06 15:23
Wolfgang wrote:
> J.O. Aho wrote:
>>> What variable is $handle and howto point $handle to my FTP
>> The $handler in the example is a resource handle that "keeps track of
>> your stream", to change where to it has to "point", you have to change
>> the $filename variable. If your ftp is another server than your
>> web-server then take a look at http://www.php.net/manual/en/ref.ftp.php
> With your advice i found:
>
> <?php
> function wwwcopy($file,$nfile)
> {
> $fp = fopen($file, "rb");
> if($fp){
> while(!feof($fp)) {
> $img = $img . fread($fp, 1024);
> }
> }
> fclose($fp);
>
> $fp2 = @fopen($nfile,"w");
> fwrite($fp2,$img);
> fclose($fp2);
> }
> ?>
>
>
> <?php
> wwwcopy("http://www.google.de/intl/de_de/images/logo.gif","out.gif")
> ?>
>
>
> which does at least save a empty out.gif on the FTP Server of my provider.
>
> Why does not my script read an image?
Are you sure that PHP you are using allows fopen on a remote location, thin
you can see that if your run phpinfo() (I'm not really sure about that).
//Aho
[Back to original message]
|