After an image is uploaded with PHP, I want to make the image can copy by neighbors in explorer.exe so server shared it's D:\xampp\htdocs and here is the code.
@move_uploaded_file($_FILES[$upload_file_name]['tmp_name'], $dir_base.$newFileName);
if (file_exists(realpath($dir_base . $newFileName))) {
error_log("
realpath
".print_r( realpath($dir_base.$newFileName) ,true)."
".date('Y-m-d H:i:s')."
",3,"html_cache/saveData.html");
//will echo D:\xampp\htdocs\projectname\data1\bg\1812061109410.png
chmod( realpath($dir_base . $newFileName),0644);
}
chmod is not working. Security has only Administrator without Everyone and System.
If I right click on xampp/tmp and add Everyone's security to it. It works fine but how can I make this by pure php?