Reply to Re: PHP FTP (French user please)

Your name:

Reply:


Posted by Justin Koivisto on 01/26/06 23:39

Sylvain GRAVERON wrote:
>> Sylvain GRAVERON wrote:
>>> Hi
>>> Sorry I don't speak english very vell and no reply in fr news ! ! !
>>
>> Contrary to popular belief, those of us who are ignorant and monolingual
>> can actually read broken English quite well. It's easier to read broken
>> (or bad) English than to try and listen to it.
>>
>> Your English is much better than my <insert any other language here>
>
> Ok, I try... (sorry=) ;-(
>
> I try do upload on file that i known name and directory in php
>
> Code :
>
> ******************************************************************
>
> $source='//srv-fic01/TeJCommun/site_web_admin/liste_vacpli.sql';
> $destination='/var/www/toitetjoie/maj/liste_vacpli.sql';
> echo $source."<br>";
> echo $destination."<br>";
> // paramèters FTP
> $ftp_serveur=('192.168.99.20');
> $conn_id=ftp_connect($ftp_serveur);
> echo $conn_id."<br>";
> $reslogin=ftp_login($conn_id,'cepas','tetj');
> echo $reslogin."<br>";
> $resput=ftp_put($conn_id,"$destination","$source",FTP_BINARY);
> echo $resput."<br>";
> ftp_quit($conn_id);
>
> ******************************************************************
>
> This de result of echos :
>
> //srv-fic01/TeJCommun/site_web_admin/liste_vacpli.sql
> /var/www/toitetjoie/maj/liste_vacpli.sql
> Resource id #2
> 1
>
> ------------------------------------------------------
>
> If and do the same think with a browse button, it's OK. The system use
> $_FILES [name]
>
>
> temp=$_FILES['url'];
> $_SESSION['vs_pj']=$temp['name'];
>
> The system call probably a temporary file and upload
>
> Thank you for help.

I'm thinking that your problem is the source file. You reference it
starting with "//"

try adding something like this to check on that:

var_dump(file_exists($source));

if you get "bool(false)" then your problem is there. In order to put the
file somewhere, the system needs to know where the source is. If it
doesn't think it exists, then you can't successfully upload it...


BTW - your english isn't that bad at all. Definitely enough to get the
message across. ;)

--
Justin Koivisto, ZCE - justin@koivi.com
http://koivi.com

[Back to original message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация