Trouble With FTP_PUT Please Help!
| From: | Adnan | Date: | Wed, 28 May 2003 12:11:47 +0000 |
| Subject: | Trouble With FTP_PUT Please Help! | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-149233@lists.php.net to get a copy of this message | ||
Hi,
i have been having trouble working out how to upload an image, the most
progress ive made is putting a blank file on the server, but thats it, any
suggestions anyone??
Im using PHP 4.3.2, Apache 1.3.27
here is the code im using!
photoposted.php
<?
$ftp_user_name='username';
$ftp_user_pass='********';
$ftp_server='xxx.xxx.xxx.xxx';
$ftp_dir='/'.$_FILES['imagefile'];
$destination_file=$ftp_dir.'';
$conn_id = ftp_connect($ftp_server);
$login_result = ftp_login($conn_id, $ftp_user_name, $ftp_user_pass);
$upload =
ftp_put($conn_id,$destination_file,$_FILES['imagefile']['name'],FTP_IMAGE);
?>
postphoto.php
<?
echo "<form action=\"/en/index.php?action=members&mp=photoposted\"
method=\"post\" enctype=\"multipart/form-data\">";
echo "Click the Browse button to find the file you wish to upload";
echo "<input type=hidden name=\"MAX_FILE_SIZE\" value=200000>";
echo "<input type=\"file\" name=\"imagefile\">";
echo "<INPUT TYPE=\"submit\" name=\"upload\"
value=\"upload\">";
echo "</form>";
?>
i am quite new to php, any suggestions would be highly appreciated!
thanks :)
adnan