무엇이 문제입니까?PHP FileUpload 오류
<form method="post" enctype="multipart/form-data" action="php/api/member_settings_profile_avatar.php">
<input type="file" name="settings_choose_avatar" id="settings_choose_avatar">
<input type="submit" value="Upload" />
</form>
PHP/API/member_settings_profile_avatar.php, 라인 2 :
move_uploaded_file($_FILES["settings_choose_avatar"]["tmp_name"], "img/test.png");
내가 유효한 .PNG 파일 제출시 다음과 같은 오류 얻을 :
Warning: move_uploaded_file(img/test.png): failed to open stream: No such
file or directory in /customers/4/1/a/mysitenamehere.com/httpd.www/php/api
/member_settings_profile_avatar.php on line 2 Warning: move_uploaded_file():
Unable to move '/customers/4/1/a/mysitenamehere.com/tmp/phpeN9wyk' to
'img/test.png' in /customers/4/1/a/mysitenamehere.com/httpd.www/php/api
/member_settings_profile_avatar.php on line 2
이 문제와인가 내 호스트 또는 뭐?
경로가 존재합니까? 업로드를 시도하기 전에 경로를 만들었습니까 (mkdir)? 경로가 맞습니까? –
@TopQuestions 질문에 대한 답이 모두 '예'인 경우 폴더에서 'is_writable'을 확인 하시겠습니까? –
경로가 맞는지, 이미지를'/ php/api/img' 폴더에 저장하겠습니까, 아니면'/ img' (모두 웹 루트와 관련이 있음)를 의미합니까? – jeroen