Upload file的临时文件夹

| No Comments | No TrackBacks

一直以来,都有这样的问题存在。
当上传文件时,如果有相同文件名的文件存在,有如下的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 的缘故。
现在再上传有相同文件名的文件时,会问你要不要覆盖原来的文件。

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


作者: David Yin
原载: FreeThinking
版权所有。转载时必须以链接形式注明作者和及本声明。

No TrackBacks

TrackBack URL: http://www.yinfor.com/mtcgi/mt-t-1010.cgi/584

Leave a comment

About this Entry

This page contains a single entry by David Yin published on 2005年3月 9日 10:26.

[转]那个忧郁的大盗 was the previous entry in this blog.

哭啼的女孩 is the next entry in this blog.

Find recent content on the main index or look in the archives to find all content.

Archives

Online Tools

Code Convertor
GeoURL
Listed on BlogShares