|
Posted by Wolfgang on 12/09/06 13:24
J.O. Aho wrote:
> Wolfgang wrote:
>
>> I still do something wrong, when I execute your Code nothing happen.
>> There is no need for me to show the picture (it does not appear either),
>> I would be happy if I had the picture on my FTP after I called my Site.
>
> see http://www.php.net/manual/en/function.fwrite.php
>
> <?php
> $filename = 'test.gif';
> // The image isn't allowed to be larger than memory_limit in php.ini
> // The download time aren't allowed to be longer than timeout for server
> // where the script is run on.
> $somecontent=file_get_contents("http://www.google.de/intl/de_de/images/logo.gif");
>
> // Let's make sure the file exists and is writable first.
> if (is_writable($filename)) {
>
> // In our example we're opening $filename in append mode.
> // The file pointer is at the bottom of the file hence
> // that's where $somecontent will go when we fwrite() it.
> if (!$handle = fopen($filename, 'a')) {
> echo "Cannot open file ($filename)";
> exit;
> }
>
> // Write $somecontent to our opened file.
> if (fwrite($handle, $somecontent) === FALSE) {
> echo "Cannot write to file ($filename)";
> exit;
> }
>
> echo "Success, wrote to file ($filename)";
>
> fclose($handle);
>
> } else {
> echo "The file $filename is not writable";
> }
> ?>
>
>
> //Aho
I get:
The file 'test.gif' is not writable
What variable is $handle and howto point $handle to my FTP
Thanks
.... wolfgang
Navigation:
[Reply to this message]
|