How to change the runtime of a tempo download?

I would like to change the application’s temporary path to a subfolder so that users on the shared server cannot see the downloaded files.

I would like to be able to do this at runtime or via .htaccess if possible (although I would like the new temporary path to be a subdirectory of the original temporary path). I can not edit php.ini on a shared server.

I know that I can verify that the tmp path occurs through sys_get_temp_dir (), but there seems to be no way to set it.

Is it possible?

+4
source share
2 answers
ini_set('upload_tmp_dir','your/path/here/'); 

The temporary directory used to store files when downloading files. Must be writable by any user PHP works like. If not specified, PHP will use the system default setting.

If the directory specified here is not rewritable, PHP reverts to the system by default. If open_basedir is enabled, then the default system directory must be enabled for booting to succeed.

upload_tmp_dir

+8
source

perhaps in '11, now no longer.

As described ini.list here and with reference to modes , 'upload_tmp_dir' cannot be changed at runtime.

thanks.

+3
source

All Articles