FTP account or restrict a folder from files being deleted or uploaded?
Hi, my goal is restrict ftp users so they can download but can't upload or delete files. I worry setting that up will stop my file transfer plugin.
What happens is files are uploaded to WordPress media library and are auto transferred to a cPanel program folder.
Plugin credit URI:
$destinationDirectory = "/home/sitename/programs";
function custom_26026551_upload($upload, $context) {
global $destinationDirectory, $watchedFilenames;
$filename = basename($upload["file">);
if(strlen($filename) - strpos(strtolower($filename), ".mp3") == 4) copy($upload["file">, $destinationDirectory . "/" . $filename);
return $upload;
}
add_filter("wp_handle_upload", "custom_26026551_upload", 10, 2);
Plugin credit URI:
-
Thank you for the confirmation! My apologies for not having a better solution. 0
Please sign in to leave a comment.
Comments
3 comments