我來自問自答了~!!
OK. 我已經找到這個問題的解答了~!
原來這個問題在 USER GUIDE 裡就有了, 只是...
它太長了, 實在沒耐心看完, 而且又是英文, 真的蠻累的...
原文如下:
10.2 Could not attach File, but Post has been stored / Filesize is 0 all over the time
If you get the Error Message 'Could not Attach File. Post has been stored' after submitting your Post.
Either your Provider does not allow the function filesize(), which is very bad, because nothing can be done to solve the problem, or your Temporary PHP Directory is not setup properly.
(Only for people hosting their own Website)
Every Attachment uploaded to the board will go into the PHP Temporary Upload Directory.
Please check the Permissions of this Directory and make sure PHP is allowed to write to it.
For users using Apache/IIS on Windows, you might want to check the following Settings:
(Thanks to SFGrimoire :: complete thread about this error)
The IUSR_hostname account needs to have read/write access to the system temp directory, otherwise you will receive the following access failure:
Event Type: Failure Audit
Event Source: Security
Event Category: Object Access
Event ID: 560
Date: 9/16/2002
Time: 12:05:52 PM
User: W2KNCHTNPC\IUSR_W2KNCHTNPC
Computer: W2KNCHTNPC
Description:
Object Open:
Object Server: Security
Object Type: File
Object Name: C:\WINNT\Temp
New Handle ID: -
Operation ID: {0,450981}
Process ID: 812
Primary User Name: W2KNCHTNPC$
Primary Domain: AFS
Primary Logon ID: (0x0,0x3E7)
Client User Name: IUSR_W2KNCHTNPC
Client Domain: W2KNCHTNPC
Client Logon ID: (0x0,0x61349)
Accesses SYNCHRONIZE
ReadData (or ListDirectory)
Privileges -
The specific permissions required are:
hostname\IUSR_hostname:(OI)(CI)(special access:)
DELETE
READ_CONTROL
SYNCHRONIZE
FILE_READ_DATA
FILE_WRITE_DATA
FILE_APPEND_DATA
FILE_EXECUTE
Also, if you change the upload directory in php.ini the IUSR_hostname account needs the same permissions.
=====================================
它的意思就是說:
在 PHP 下會有一個設定是設定 PHP 在上傳檔案時的暫存目錄位置.
在 PHP.INI 中, 如果是 WINDOWS 的使用者則應該在 C:\WINNT\PHP.INI
(沒有設定的話則會使用 WINDOWS 的預設值, 小弟建議大家還是設定一下好了, 因為這個 資料夾等一下要改權限, 還是分開的好 )
在這一行改一下, 如下: (C:\WINNT\PHP.INI)
;;;;;;;;;;;;;;;;
; File Uploads ;
;;;;;;;;;;;;;;;;
; Whether to allow HTTP file uploads.
file_uploads = On
; Temporary directory for HTTP uploaded files (will use system default if not
; specified).
upload_tmp_dir = C:\PHP\ul_temp
; Maximum allowed size for uploaded files.
upload_max_filesize = 2M
就是那個 upload_tmp_dir = 的地方, 設定之前可別忘了先去新增一毎子目錄唷~再在這個地方填入你新增的位址.
然後到這個新增的 資料夾 選擇 "內容" 更改權限, 這個資料夾的使用者加入一個 "IUSR_你的SERVER名稱" 的使用者, 給這個 使用者 "讀取" 及
"寫入" 的權限, 就 OK 了.
很簡單吧~