更改PHP文件上传的默认临时目录 [英] Change default temp directory for PHP file uploads
本文介绍了更改PHP文件上传的默认临时目录的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我在本地制作一个网站,允许上传.pdf文件,当这些文件上传到 C:\xampp\tmp
,但是当我在我的大学服务器上托管我的网站我没有访问临时目录,有什么办法可以改变文件的默认临时位置吗?
$ b
谢谢
Dave。
解决方案
试试这个。
运行putenv( 'TMPDIR = /路径/到/ DIR');
比您可以检查您的tmp目录
sys_get_temp_dir()
I'm making a website locally that allows the upload of .pdf files, when these are uploaded locally they go to C:\xampp\tmp
but when I host the site on my University server I don't have access to the temporary directory, is there any way I can change the default temporary location for the file?
Thanks in advance, Dave.
解决方案
Try this.
putenv('TMPDIR=/path/to/dir');
than you can check your tmp directory
sys_get_temp_dir()
这篇关于更改PHP文件上传的默认临时目录的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文