开发者

When uploading a very large file in PHP, how much RAM is required on the server?

开发者 https://www.devze.com 2023-03-03 13:21 出处:网络
I readhttp://www开发者_如何学Go.php.net/manual/en/ini.core.php#ini.post-max-size. memory_limit must > post_max_size . Then ifuser upload a file 500MB then how much total RAM use ?

I read http://www开发者_如何学Go.php.net/manual/en/ini.core.php#ini.post-max-size.

memory_limit must > post_max_size . Then if user upload a file 500MB then how much total RAM use ?

does it use >500MB ?


No, memory_limit need not be greater than post_max_size.

PHP has different POST readers and handlers depending on the content type of the request. In case of "multipart/form-data" (what is used for sending files), rfc1867_post_handler acts as a mixed reader/handler. It populates both $_POST and $_FILES. What goes into $_POST counts towards the memory limit, what goes into $_FILES also counts.

However, $_FILES has just meta-data about the files, not the files themselves. Those are just written into the disk and hence don't count towards the memory limit.

0

精彩评论

暂无评论...
验证码 换一张
取 消