서버에 여러 파일을 업로드하고 싶습니다.업로드 오류 - 파일을 쓸 수 없습니다.
필자가 볼 수있는 한 파일은 쓰기 가능하지 않습니다.
내 코드가 실제로 작동하고 파일을 업로드 할 수 있도록하려면 어떻게해야합니까?
PHP :
는if(isset($_FILES ['uploaded_files']))
{
foreach($_FILES['uploaded_files']['name'] as $key=>$value)
{
if(is_uploaded_file($_FILES['uploaded_files']['tmp_name'][$key]) && $_FILES['uploaded_files']['error'][$key] == 0)
{
$filename = $_FILES['uploaded_files']['name'][$key];
if (is_writable($filename)) {
echo 'The file is writable';
} else {
echo 'The file is not writable';
}
if(move_uploaded_file($_FILES['uploaded_files']['tmp_name'][$key], '../images/gallery'. $filename))
{
//code
}
else
{
die ('There was a problem uploading the pictures.');
}
}
else
{
die ('There is a problem with the uploading system.');
}
}
}
HTML : 당신은 당신이 최근에 업로드했지만 아직 저장되지 않은 파일에 쓰기 권한이 있는지 확인하는
<form enctype="multipart/form-data" action="upload.php" method="POST">
<input type="hidden" id="input_clone_id" name="input_clone_id" value="'.$row['id'].'"/>
<input type="hidden" id="input_clone_var" name="input_clone_var" value="V"/>
<input type="file" name="uploaded_files[]" id="input_clone" multiple="multiple" /><br />
<input type="submit" style="margin-left:0" value="Upload Files" />
</form>
자세한 답변을 보내 주셔서 감사합니다. 현재 로컬 호스트에서 작업 할 때 컴퓨터를 사용하고 있습니다. 쓰기 가능한 폴더인지 확인하는 방법을 알려줄 수 있습니까? –
Windows 또는 Linux? –
windows ......... –