$ _FILES ['File'] ['size'] upload_max_filesize üzerinden dosya için 0 (sıfır) yankılanan

2 Cevap php

Sorun dosya ben ilgili bir hata iletisi görüntüler böylece yüklemek için çok büyük olup olmadığını kontrol etmek istediğiniz, ancak dosya, php.ini içindeki upload_max_filesize daha büyük olduğunda yalnızca bir 0 görüntüleme gibi görünüyor.

Bu neden oluyor? Nasıl dosya ilgili bir hata vermek için çok büyük olup olmadığını test edebilirsiniz?

2 Cevap

Bkz http://php.net/manual/en/features.file-upload.errors.php

İlgili alıntı:

Since PHP 4.2.0, PHP returns an appropriate error code along with the file array. The error code can be found in the error segment of the file array that is created during the file upload by PHP. In other words, the error might be found in $_FILES['userfile']['error'].

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.

dosya mevcut ve 0 söyleyerek olduğu gerçeği bir hata genellikle dosya boyutu limiti bitti ... oluştuğunu gösterir. That's the relevant error.

edit: yorumcu altında bahseder gibi, ilgili hata ['userfile'] ['error'] $ HTTP_POST_FILES üzerinde.