Creating temp directory on server

Is it possible to create a temporary directory on a hosting server with the same functionality as the tmp folder in the root directory?

I need a second tmp folder to temporary store files that I'm uploading to another web service. I want to avoid unlink() functions or cron jobs for deleting files.


Yes you can .... using System::mktemp

$tempfile = System::mktemp("prefix");       
$tempdir  = System::mktemp("-d prefix");
$tempfile = System::mktemp();
$tempfile = System::mktemp("-t /var/tmp prefix");

Or you can run the command using exec

  mktemp  make temporary dirname
链接地址: http://www.djcxy.com/p/72798.html

上一篇: 尽管临时目录存在,但无法在PHP中创建临时文件

下一篇: 在服务器上创建临时目录