PHP file upload: reading raw files

As far as I know, $_FILES["fieldname"]["size"]contains the file size after the file has been downloaded.

In Perl, you can easily read the raw data of a file, and thus determine if the file is too large before it is fully loaded.

Is there an easy way to do the same in PHP?

+4
source share
2 answers

You can change the maximum size in the configuration file php.ini, but it will affect all your file downloads :

upload_max_filesize 10M

If you use a file .htaccess, you can also write like this:

php_value upload_max_filesize 10M

Take a look at the doc

+2
source

, . , javascript , .

, FileReader .

fooobar.com/questions/75154/... .

0

All Articles