0
我試圖上傳使用HTML表單和PHP文件,代碼是這樣的:HTML上傳文件的目錄不存在
$targetPictureLocation = "/files/images/team/" . strtolower(str_replace(" ","", $_POST['name'])) . ".png";
move_uploaded_file($_FILES['file']['tmp_name'], $targetPictureLocation);
現在我相信了$targetPictureLocation
refrences www.domain.com/targetpath/
因爲有削減文件的盈方。這是正確的嗎?如果是這樣,然後目錄確實存在,但是我得到這些錯誤:
Warning: move_uploaded_file(/files/images/team/foobar.png) [function.move-uploaded-file]: failed to open stream: No such file or directory in /home/content/08/11798508/html/domainname/files/scripts/userManagement.php on line 259
Warning: move_uploaded_file() [function.move-uploaded-file]: Unable to move '/tmp/phpwzO4X7' to '/files/images/team/foobar.png' in /home/content/08/11798508/html/domainname/files/scripts/userManagement.php on line 259
我做錯了什麼?
謝謝你這麼多
嘗試'$ _ SERVER [ 'DOCUMENT_ROOT']「。/domainname/files/images/team /「。 strtolower(str_replace(「」,「」,$ _POST ['name']))。 「.png」;''tartgetPictureLocation''中的'' – Subin
同樣的錯誤,除了原路徑中沒有'domainname'這樣的錯誤 –
http://chat.stackoverflow.com/rooms/47580/html-upload-file -directory - 不 - 不存在 – Subin