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: https://alcos.dev/p/26026551
Then our ftp users can download the files from the program folder. Somehow I need to find another way to do this or restrict this folder from people uploading and deleting files.
I didn't original set this up but it's what I have to work with. Any thoughts on how to restrict this folder?
Thank you for your time
Kim
What happens is files are uploaded to WordPress media library and are auto transferred to a cPanel program folder.
Code:
$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);
Then our ftp users can download the files from the program folder. Somehow I need to find another way to do this or restrict this folder from people uploading and deleting files.
I didn't original set this up but it's what I have to work with. Any thoughts on how to restrict this folder?
Thank you for your time
Kim