I have some problem with uploading a file from my harddisk using a ftp connection.
Here are the 2 files:

test.php contains the form:

<table>
<form method="get" action="test2.php" enctype="multipart/form-data">
<tr class=cen>
<td>Titlu gif</td>
<td>&nbsp;::&nbsp;</td>
<td><input type="file" name="util" class=form1><br><input type="submit" 
value="expediaza"</td>
</tr>
</form>
</table>

and test2.php is the script for upload :

<?
$ftp_server="*****";
$con = ftp_connect($ftp_server); 

// login with username and password
$login_result = ftp_login($con, "*****", "*******"); 

if ((!$con) || (!$login_result)) { 
        echo "FTP connection has failed!";
        echo "Attempted to connect to $ftp_server"; 
      $error=1;
    } else {
        echo "Connected to $ftp_server <br>";
    }


$util=strtolower($util);

$destination="tit.gif";
if(ftp_put($con, $destination, $util, FTP_BINARY)){echo "OK ,am pus titlul <br>";}
else{ echo "eroare<br>";$error=1;}

?>

Thanks in advanced



Reply via email to