Re: FTP a file
| From: | Chris Dowell | Date: | Sun, 23 Jul 2000 00:45:00 +0000 |
| Subject: | Re: FTP a file | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-7736@lists.php.net to get a copy of this message | ||
ive only been learning php for eight days, but i've already encountered this
problem
you need to change to file permissions for the file you've created
see http://www.php.net/manual/function.chmod.php
this is one of the standard filesystem functions, so your' lack of ftp
functions won't matter
hope this helps
chris dowell
----- Original Message -----
From: Chris Murtland <chris@studiomoxie.com>
To: <php-general@lists.php.net>
Sent: Saturday, July 22, 2000 9:43 PM
Subject: [PHP] FTP a file
> I am trying to ftp a file to my machine, using fopen and fwrite. Here is
my
> code (paths and IP changed to protect the guilty):
>
> $fs=fopen("/home/db.txt","r");
> $size=filesize("/home/db.txt");
> $body = fread($fs,$size);
> fclose($fs);
> $fp = fopen("ftp://user:password@$ip/upload/db.txt",
> "w");
> fwrite($fp,"$body \r\n",$size);
> fclose($fp);
>
> It successfully logs into my FTP server and creates a blank file named
> db.txt in the upload directory. How do I get it to write the contents to
the
> file?
>
> I don't have the ftp functions installed on my server, so I can't use
those.
>
> Thanks,
> Chris
>
> ---------------------------------------------
> Chris Murtland
> Studio Moxie, LLC
> 336.773.1684
> 877.284.0462 fax/voicemail
> 62384610 ICQ
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net
> For additional commands, e-mail: php-general-help@lists.php.net
> To contact the list administrators, e-mail: php-list-admin@lists.php.net
>
>