note 31433 rejected from function.ftp-put by spic

From: Date: Mon, 21 Apr 2003 20:46:34 +0000
Subject: note 31433 rejected from function.ftp-put by spic
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-46910@lists.php.net to get a copy of this message
When I try to use some of the examples, it does not work. For some reason the following does not work. The informaiton on the local files comes from a form that the user uses to upload several files. I just list two as an example [code] <form method=post action='<?=$PHP_SELF?>?webaction=upload'> <input type=file name='upfile[]' size=34> <input type=file name='upfile[]' size=34> <input type=submit value=submit> </form> [/code] When the use submits the files to upload, an ftp connection is successfully made then: [code] if($webaction=='upload'){ $file = explode("\\", $upfile[$i]); $rfile=array_pop($file); /*remote filename*/ $lfile = $upfile[$i]; /*local path to filename*/ /*i.e. "C:\\directory\\subdir\\firstfile.wmv"*/ $i=0; while($upfile[$i]){ $upload=ftp_put($ftp_conn,$rfile, $lfile, FTP_BINARY); if(!$upload){ echo "Upload failed"; }else{ echo "Successfully uploaded file"; } $i++; } [/code] Does the "\\" in the pathname to the file make a differences? Mike

« previous php.notes (#46910) next »