Nieuw lid |
|
Goede middag,
ik probeer hier een bestand te uploaden via php... Het rare is, de ene keer lukt het, de andere keer niet 
Mijn map waar ik het naartoe wil is schrijfbaar voor iedereen (777) en er staan al een paar bestanden in die upgeload werden door het php script...
Hier mijn code:
$conn_id = ftp_connect($ftp_host);
$login_result = ftp_login($conn_id, $ftp_user, $ftp_pass);
$target_path = "httpdocs/site/Public/Downloads/ftp/";
$source_file = $_FILES['file']['tmp_name'];
$destination_file = $_FILES['file']['name'];
ftp_chdir($conn_id, $target_path);
chmod($destination_file,0777);
$upload = ftp_put($conn_id, $destination_file, $source_file, FTP_BINARY);
if (!$upload)
{
echo 'Error';
}
else
{
echo 'blaat';
}
ftp_close($conn_id);
$login_result = ftp_login($conn_id, $ftp_user, $ftp_pass); $target_path = "httpdocs/site/Public/Downloads/ftp/"; $source_file = $_FILES['file']['tmp_name']; $destination_file = $_FILES['file']['name']; chmod($destination_file,0777); $upload = ftp_put($conn_id, $destination_file, $source_file, FTP_BINARY ); if (!$upload) { } else { }
En ik krijg telkens volgende foutmelding:
Citaat: Warning: chmod() [function.chmod]: No such file or directory in httpdocs/site/admin/upload/index.php on line 157
waar in regel 157 het volgende staat:
chmod($destination_file,0777);
chmod($destination_file,0777);
Het rare is dat het de ene keer werkt en de andere keer niet 
Groeten
|