I would like to change my applications temp path to a subfolder, so that users on a shared server cannot see any uploaded files.
I would like to be able to do this run-time, or via .htaccess if possible (although I would like the new temp path to be a subdir of the original temp path). I can't edit the php.ini on the shared server.
I know I can check what the tmp path is via sys_get_temp_dir(), but there doesn't seem to be a way to set it.
Is this even possible?
ini_set('upload_tmp_dir','your/path/here/');
The temporary directory used for storing files when doing file upload. Must be writable by whatever user PHP is running as. If not specified PHP will use the system's default.
If the directory specified here is not writable, PHP falls back to the system default temporary directory. If open_basedir is on, then the system default directory must be allowed for an upload to succeed.
upload_tmp_dir
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With