언젠가 2MB 미만의 파일을 업로드 할 때가 있습니다. php.ini의 기본값 인 upload_max_filesize
은 2M이 2MB를 의미하기 때문에 정상적으로 업로드됩니다. 기타 파일 크기가 2MB 이상이면 php.ini에서 upload_max_filesize
의 변경이 필요합니다. 당신은 여기가 관련 값
UPLOAD_ERR_OK
Value: 0; There is no error, the file uploaded with success.
UPLOAD_ERR_INI_SIZE
Value: 1; The uploaded file exceeds the upload_max_filesize directive in php.ini.
UPLOAD_ERR_FORM_SIZE
Value: 2; The uploaded file exceeds the MAX_FILE_SIZE directive that was specified in the HTML form.
UPLOAD_ERR_PARTIAL
Value: 3; The uploaded file was only partially uploaded.
UPLOAD_ERR_NO_FILE
Value: 4; No file was uploaded.
UPLOAD_ERR_NO_TMP_DIR
Value: 6; Missing a temporary folder. Introduced in PHP 4.3.10 and PHP 5.0.3.
UPLOAD_ERR_CANT_WRITE
Value: 7; Failed to write file to disk. Introduced in PHP 5.1.0.
UPLOAD_ERR_EXTENSION
Value: 8; A PHP extension stopped the file upload. PHP does not provide a way to ascertain which extension caused the file upload to stop; examining the list of loaded extensions with phpinfo() may help. Introduced in PHP 5.2.0.'
참고로 여기
var_dump($_FILES['image']['error'])
목록을 당신에게 오류를 확인할 수 있습니다 - 파일을 업로드하는 동안 http://php.net/manual/en/features.file-upload.errors.php이
일부 오류가 있어야합니다. 우리에게'var_dump ($ _ FILES [ 'image'] [ 'error']); – Rikesh
당신이 대답을 얻는다면 가장 도움이되는 대답을 선택하십시오. 그렇지 않으면 자신의 답변을 게시 할 수 있습니다. – MageDev