RE: [PHP] Re: ftp question
| From: | victor | Date: | Tue, 03 Sep 2002 01:55:56 +0000 |
| Subject: | RE: [PHP] Re: ftp question | ||
| References: | 1 | Groups: | php.general php.general |
| Request: | Send a blank email to php-general+get-114971@lists.php.net to get a copy of this message | ||
Actually, that is the correct path. Which is why I don't understand why
it's not working. And as a user I'm using myself... waitaminute, the
folders are created by the user www, and I argilent may not have write
permission, maybe that's why it's not working. I should try with a
folder I create as me to see if I can write to it.
- Victor > www.argilent.com
-----Original Message-----
From: nicos@php.net [mailto:nicos@php.net]
Sent: Monday, September 02, 2002 9:46 PM
To: php-general@lists.php.net
Subject: [PHP] Re: ftp question
Hi,
Your script upload the file to
/home/victor/argilent-www/sites/kodak/user_pictures/vic/
are you sure that is the correct path name? If its not, just put the
entier
name and not only a part of it.
--
Merci de nous avoir choisi. - Thanks you for your choice.
Nicos - CHAILLAN Nicolas
nicos@worldakt.com
nicos@php.net
www.GroupAKT.com - Hébergement Group.
www.WorldAKT.com - Hébergement de sites Internet
"Victor" <victor@argilent.com> a écrit dans le message de news:
000001c252ea$36e90160$a3a96518@jumpy...
> I took the scriopt from php manual and adapted it to my needs, but I
get
> an error:
>
> Warning: ftp_put(): user_pictures/vic/: No such file or directory in
> /home/victor/argilent-www/sites/kodak/upload_picture.php on line 103
>
> This is the code:
>
> # set up basic connection
> $conn_id = ftp_connect($ftp_server);
>
> # login with username and password
> $login_result = ftp_login($conn_id, $ftp_user, $ftp_pass);
>
> # check connection
> if ((!$conn_id) || (!$login_result)) {
> echo 'FTP connection has failed.';
> exit;
> }
> $destination = $picture_location.'/'.$f_username.'/';
> # upload the file
> $upload = ftp_put($conn_id, $destination, $picture, FTP_BINARY);
>
> # check upload status
> if (!$upload) {
> echo 'FTP upload has failed.';
> }
>
> # close the FTP stream
> ftp_close($conn_id);
>
> I added the destination variable so that I can easily edit the
> destination if I sweitch servers, I'm guessing the error occurs
because
> php doesn't know where to take the file from?! I'm guessing here, but
it
> would be nice if someone tough me a bit more about ftp with php.
>
> user_pictures/vic is the directory the $picture has to go in, but I
> dunno why it doesn't work.
>
> - Victor > www.argilent.com
>
>
> ______________________________________________________________________
> Post your free ad now! http://personals.yahoo.ca
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
______________________________________________________________________
Post your free ad now! http://personals.yahoo.ca