Dear Developer,
i tried this code below :
[CODE]
<?php
$ftp_server=’172.16.0.44′;//serverip
$conn_id = ftp_connect($ftp_server,8021);
// login with username and password
$user=”artemis”;
$passwd=”baltazhor200401″;
$login_result = ftp_login($conn_id, $user, $passwd);
// check connection
if ((!$conn_id) || (!$login_result)) {
echo “FTP connection has failed!”;
echo “Attempted to connect to $ftp_server for user $ftp_user_name”;
die;
} else {
echo “<br>Connected to $ftp_server, for user $user<br>”;
}
if(isset($_POST[‘Submit’])){
$upload = ftp_put($conn_id, “upload/”.$_FILES[‘file’][‘name’], $_FILES[‘file’][‘tmp_name’], FTP_BINARY);
if (!$upload) {
echo “FTP upload has failed!”;
} else {
echo “Uploaded $source_file to $ftp_server as $destination_file”;
}
}
ftp_close($conn_id);
?>
<table width=”100″ border=”0″ cellspacing=”1″ cellpadding=”1″>
<form name=”form1″ method=”post” action=”test_ftp.php” enctype=”multipart/form-data”>
<tr>
<td width=”52″ nowrap>File</td>
<td width=”10″ nowrap>:</td>
<td width=”28″ nowrap><input type=”file” name=”file”></td>
</tr>
<tr>
<td nowrap> </td>
<td nowrap> </td>
<td nowrap><input type=”submit” name=”Submit” value=”Copy”></td>
</tr>
</form>
</table>
but then i found this error :
[B]Warning: ftp_put() [function.ftp-put]: Opening data channel for file transfer. in ***
could you tell me why ?
Thanks