我想使用PHP上傳文件。我與形式的HTML頁面存儲在WAMP:無法打開流:沒有這樣的文件或目錄
C:\wamp\www\myproject\upload.html
PHP頁面
C:\wamp\www\myproject\upload.php,
,我要上傳的文件是
C:\wamp\www\myproject\openoffice.txt.
當我嘗試要上傳的文件,我收到以下錯誤:
Warning: move_uploaded_file(/uploads/openoffice.txt) [function.move-uploaded-file]: failed to open stream: No such file or directory in C:\wamp\www\myproject\upload.php on line 40
Warning: move_uploaded_file() [function.move-uploaded-file]: Unable to move 'C:\wamp\tmp\phpF66A.tmp' to '/uploads/openoffice.txt' in C:\wamp\www\myproject\upload.php on line 40 Problem: could not move file to destination directory
以下是upload.php的線條40-43:
if (!move_uploaded_file($_FILES['userfile']['tmp_name'], $upfile)) {
echo 'Problem: could not move file to destination directory';
exit;
}
,它的在看,而不是upload.php的,它是在讓我不知道它是否是一個服務器錯誤或與我的PHP的問題的文件夾的事實。
我用Google搜索,並得到this建議,但我不知道這是否是正確的意見,或如何實現它。幫幫我?
一個經常運行到這個錯誤,並迅速解決它,請按照下列步驟操作:https://stackoverflow.com/a/36577021/2873507 – 2016-04-12 15:58:48