if i connect with my ftp client with the same user pwd i use with the following script all works correctly
but if i use
$conn_id = ftp_connect($ftp_server);
// login with username and password
$login_result = ftp_login($conn_id, $ftp_user_name, $ftp_user_pass);
// check connection
if ((!$conn_id) || (!$login_result)) {
echo "FTP connection has failed!";
echo "Attempted to connect to $ftp_server for user $ftp_user_name";
exit;
} else {
echo "Connected to $ftp_server, for user $ftp_user_name";
}
ftp_chdir($conn_id, "remoteserverPath/tmp/");
// upload the file
$upload = ftp_put($conn_id, $filez_name, $filez, FTP_BINARY);
// check upload status
if (!$upload) {
echo "FTP upload has failed!";
} else {
echo "Uploaded $myfile to $ftp_server as $myfile";
}
// close the FTP stream
ftp_close($conn_id);
it returns this error
Connected to "my server ip", for user myUser
Warning: ftp_put(): myfile.jpg: Permission denied.
FTP upload has failed!
why permission denied?
i can upload with the client ftp , what makes the error for this script?
thank you