승 내 스크립트 :.mp3 및 이미지 파일 업로드; 차이 여기에 두
<html>
<body>
<?php
if(isset($_POST['submit']))
{
echo $_FILES['upload']['tmp_name']/['name']/['error']/['type'];
// i.e. echoing all the temproray file location; name error status and type of file.
}
?>
<form enctype="multipart/form-data" action="<?php echo $_SERVER['PHP_SELF']; ?> method="post" />
<input type="hidden" name="MAX_FILE_SIZE" value="SOME_VALUE" />
<input type="file" name="upload" id="upload" />
<input type="submit" name="submit" />
</body>
</html>
입니다/B 지금 여기에 문제가 있습니다; 기본적으로 사용자가 사이트에서 음악을 업로드하고 싶습니다. 하지만 몇 가지 .mp3 파일을 사용하여이 코드를 테스트 할 때 다음과 같은 문제가 발생합니다.
8메가바이트은 (내 생각) 코드의
isset($_POST['submit'])
상태로하지 않는다는 것을 더 크기 어떤 파일 .. 그나마 이유를 알고있다. NOTHING 이름 : 난 후 작은 크기의 파일을 업로드 할 때지금 나는 다음과 같은 출력
tmp_name 얻을 이름 파일이 표시됩니다 오류 : 1 (파일이 업로드되지 않은 즉, ??) 유형 : 아무것도
3 지금 나는 내가 원하는 모든 결과를 얻을의 .jpeg 파일을 업로드 할 때. 즉
tmp_name : Windows/temp/ BLAH...
name : name of file
error : 0 (i.e. successful upload)
type : jpeg
왜 이런 일이 발생합니까?
또한 사용자가 오디오 파일을 업로드하는 더 좋은 방법이 있습니까?
과 :
이러한 설정을 사용하면 업로드 할 수있는 최대 파일 크기를 결정하는 방법은 무엇입니까? – Kraken
은'upload_max_filesize'와'post_max_size'를 약 20MB로 설정합니다. 또한'max_execution_time'과'max_input_time'을 검토합니다 (마지막 두 개를 약 200으로 설정). – noob
@RageZ thanks! :) – Kraken