Upload file的临时文件夹

作者:


最后更新于 | 最初发布于 | 分类:


一直以来,都有这样的问题存在。
当上传文件时,如果有相同文件名的文件存在,有如下的error message出现

Error in tempfile() using \tmp\XXXXXXXXXX: Parent directory (\tmp\) is not a directory at C:\intranet\mt\lib/MT/App/CMS.pm line 3883
这里的C:\intranet\mt\是我的系统目录。

昨天仔细看了一下mt.cfg配置文件,找到下面:

# When processing uploaded files, if Movable Type notices that the file you
# uploaded already exists, it will allow you to overwrite the original file,

# by first asking for your confirmation. To do this, MT needs to write the

# uploaded data to a temporary file. That temporary file is stored in the

# directory specified by the TempDir setting; the value defaults to /tmp.

#

#TempDir /tmp/

就修改为:

TempDir c:\intranet\mt\tmp\
这里要用绝对路径,因为是Windows Server 的缘故。
现在再上传有相同文件名的文件时,会问你要不要覆盖原来的文件。

如果你有同样的问题,照样修改,就可以了。





关于作者
搜索
归档

Online Tools

Code Convertor