2013-04-02 2 views
0

html 입력 태그를 사용하여 4608X3500 픽셀과 같은 더 큰 크기의 이미지를 업로드하려고합니다. 그러나 파일 크기를 가져올 수 없습니다.입력을 사용하여 큰 이미지를 업로드 할 때 오류가 발생했습니다.

나는 파일 정보를 얻기 위해이 코드를 사용하고이에

$userfile_name = $_FILES['image']['name']; 
$userfile_tmp = $_FILES['image']['tmp_name']; 
$userfile_size = $_FILES['image']['size']; 
$userfile_type = $_FILES['image']['type']; 
$filename = basename($_FILES['image']['name']); 

, 내가 유형 값을받지 오전 크기 값은 0

+0

일부 오류가 있어야합니다. 우리에게'var_dump ($ _ FILES [ 'image'] [ 'error']); – Rikesh

+0

당신이 대답을 얻는다면 가장 도움이되는 대답을 선택하십시오. 그렇지 않으면 자신의 답변을 게시 할 수 있습니다. – MageDev

답변

0

변경 upload_max_filesize을 php.ini 파일에

0

C : \ WAMP이 검색 php.ini 파일과이 파일의 빈 \ PHP는 \의 php5.2.6

\ 당신 upload_max_filesize를 설정해야합니다 ...

0

언젠가 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

관련 문제