This is in reference to this question - need something that is same as $_FILES from remote server download with php
In the above post, what the OP basically wants is to manually populate the $_FILES superglobal array for file uploads.
In the answer, you will see the use of tempnam to create a temporary file and storing the resource in it by using file_get_contents, which i think should work in theory (not tested).
Now, my question is doesn't PHP has any checks in order to detect and prevent this behavior or how does post-max-size / upload-max-filesize ini values affect this manually created $_FILES array?
The post_max_size and upload_max_filesize will have no affect whatsoever on the scenario in the question that you linked to because they are making an outgoing connection to a remote source to get the data. The two ini settings will only have an affect on POST data that is sent to your script (ie incoming).
PHP does not do any checks on changes to the $_FILES array, you can freely modify the array with no limitations.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With