Of course I use the umask function - although I knew up front that it wasn't going to help in my case:
Originally Posted by paulm
IMHO, the problem has to do with the PHP script running under the PHP session, which is not the same as the owner of the Zen Cart directories. This is understandable and good for security purposes.
$copyfile_errmsg = "Can't copy " . $origin_filename . " to " . $temp_filename;
copy($origin_filename, $temp_filename) or die($copyfile_errmsg);
However, what I don't understand is how that mkdir(DIR_FS_DOWNLOAD_PUBLIC . $tempdir, 0777) manages to succeed in creating that $tempdir... Are the permission rules different for creating directories vs. creating files?