0
내 서버에 파일 업로드에 대한 자습서를 진행했습니다. 스크립트가 작동하는 것처럼 보이지만 업로드 디렉토리를 보면 아무 것도 없습니다.PHP 파일 업로드 스크립트가 실패합니다.
<?php
$file_result="";
if ($_FILES["file"]["error"] > 0)
{
$file_result .= "No file uploaded or invalid file.";
$file_result .= "Error code: ". $_FILES["file"]["error"]. "<br>";
} else {
$file_result .=
"Upload: " . $_FILES["file"]["name"] . "<br>" .
"Type: " . $_FILES["file"]["type"] . "<br>" .
"Size: " . ($_FILES["file"]["size"]/1024) . " Kb<br>" ;
"Temp file: " . $_FILES["file"]["tmp_name"] . "<br>";
move_uploaded_file($_FILES["file"]["tmp_name"],
"full/path/on/server" . $_FILES["file"]["name"]); //Actual address removed
$file_result .= "File Upload Successful!";
} echo $file_result;
?>`
html로는 다음과 같다 :`업로드에 대한 코드를 다음
<form enctype="multipart/form-data" action="upload_file.php" method="post">
Browse Files:<br>
<input name="file" type="file" id="file" size="80"><br>
<input type="submit" id="u_button" name="u_button" Value = "Upload the File">
</form>
`
오류보고를 켜고 오류를 해결하는 시작, 행복 디버깅 . – Epodax
대상 폴더에 쓰기 권한이 있습니까? – AkshayP
enctype을 사용하지 않았습니다. 양식을