Zen Follower
- Join Date:
- Jun 2008
- Posts:
- 338
- Plugin Contributions:
- 0
How does mkdir(DIR_FS_DOWNLOAD_PUBLIC . $tempdir, 0777) succeed?
The PHP script includes/modules/pages/download/header_php.php creates a temporary subdirectory in directory pub, although pub's permissions are identical to all other Zen Cart directories (755):
drwxr-xr-x 3 zcnb zcnb 4096 Jul 24 16:24 pub
I was trying to create a temporary file in the download directory in the same manner, in that same exact includes/modules/pages/download/header_php.php file, but that operation fails. I understand that for security reasons, the script handling customer's download session should not be able to write/create a file in any directory. But the fact that Zen Cart is able to do so inside the same PHP script I am trying to modify, hints that there is a way to succeed in what I am trying to accomplish.
What is the proper way to create/copy a file (on the fly, as a result of the customer clicking the 'download' button) inside the download directory?
Thanks,
Daniel