Move_uploaded_file function
Uploading files
Now the requirement is that you can upload any file
However, the total file size cannot exceed 5M
What should be done??
Reply to discussion (solution)
The limit of upload file size is generally changed in php.ini and httpd.conf configuration files, such as php.ini.
Upload_max_filesize = 8M
Post_max_size = 10M
Memory_limit = 20M
This type of Setup, in Httpd.conf, has
Limitrequestbody 10485760
This type of Setup
However, in the PHP file you can directly determine the size of the upload file, such as judging $_files["file" ["size"] if greater than 5M will not move_uploaded_file move.
The limit of upload file size is generally changed in php.ini and httpd.conf configuration files, such as php.ini.
Upload_max_filesize = 8M
Post_max_size = 10M
Memory_limit = 20M
This type of Setup, in Httpd.conf, has
Limitrequestbody 10485760
This type of Setup
But you are in the PHP text ...
The total file size ~ ~ is not a single, it seems wrong
Upload the corresponding file upload information (according to the user, the total size of the upload file with database or file record or the user uploads each file size)
Is it not possible to make a corresponding judgment afterwards?
Confirm in PHP.ini
session.upload_progress.enabled = On
Session.upload_progress.cleanup = Off
You can be in
$_session["Upload_progress_laruence" ["Content_length"]
The total size of the uploaded file in the
I don't think you would exclude PHP 5.4, would you?
Upload the corresponding file upload information (according to the user, the total size of the upload file with database or file record or the user uploads each file size)
Is it not possible to make a corresponding judgment afterwards?
That makes sense, but it seems that my demand may be no solution, mainly upload attachments to send mail, once so much,
For example, for the first time, you could pass 19M.
The second time can still be a total of 19M
Even in a database, it's not good to judge
Confirm in PHP.ini
session.upload_progress.enabled = On
Session.upload_progress.cleanup = Off
You can be in
$_session["Upload_progress_laruence" ["Content_length"]
The total size of the uploaded file in the
I don't think you will exclude PHP 5.4 ...
Forget, PHP version of its own can not be changed ~ Customer's server ~
You should be a single user upload total size bar, recorded in the database is better, each user add an upload total size field, each comparison and update.
Reference 3 floor Ohmygirl reply: Upload the corresponding file upload information (according to the user, the total size of the upload file with database or file record or the user uploads each file size)
Is it not possible to make a corresponding judgment afterwards?
That makes sense, but it seems that my demand may be no solution, mainly upload attachments to send mail, once so much,
For example, for the first time, you could pass 19M.
The second time can still be a total of 19M
Even in a database, it's not good to judge
......
That is, each email attachment can not be greater than 5M, it is good to judge Ah, the total size of the database record upload, can not be greater than 5M, each time after the file is sent empty to 0 recalculation.
The landlord bit content is wrong, not 5M, is the total size of the attachment of a send message should not exceed 20m~
Forget, PHP version of its own can not be changed ~ Customer's server ~
That's not going to be an addition, is it?