When trying to upload a PDF
file that was 15mb through an admin area created for doing so, nothing happened. There was no success or error message, but the PDF
did not upload.
I then thought that it could be an issue with the php.ini
settings. Sure enough, when I looked at the file, I found that the limits were set to 8m. Which I'm assuming means 8mb.
post_max_size: http://php.net/post-max-size
; Maximum size of POST data that PHP will accept.
; Its value may be 0 to disable the limit. It is ignored if POST data reading
; is disabled through enable_post_data_reading.
post_max_size = 20M
upload_max_filesize: http://php.net/upload-max-filesize
; Maximum allowed size for uploaded files.
upload_max_filesize = 20M
Looking at the comments, it appears that one is for files being uploaded, while the other relates directly to POST
data. What I'm confused about is this scenario: If you have a form that is POST
'ing an image to another page, what does that count as, upload_max_filesize
or post_max_size
? Does it fall under both? Does one take precedence? Are there cases where one would be used and not the other?
Edit:
So if I have a form that has 3 file inputs, all allowing files 20mb or smaller, the settings would have to be set like so:
upload_max_filesize = 20M
post_max_size = 60M
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…