doujinai2183 2015-10-16 20:33
浏览 49

通过什么机制(如果有的话)强制执行php.ini的upload_max_filesize?

After looking at this question about upload_max_filesize, I started to wonder: since ini_get simply returns the raw string-value (e.g. '15M'), what component actually reads this value and then uses it to limit uploads? Would it be Apache or the CGI-engine? Or is this handled by essential PHP-runtimes instead?

For the former, I would assume that most softwares which can serve PHP-pages have a way of converting this shorthand ini-value to bytes (or some machine-usable integer) and then notifying PHP when this limit has been exceeded during a POST action. Is this indeed the case? (Maybe PHP converts the string first?)

TL;DR: What component is responsible for picking up the upload_max_size value and passing it to the enforcement mechanism(s)? Or alternatively: Does this setting indeed exist strictly to allow a DIY-implementation of this limit?

Why I ask: The answers given in the linked question are somewhat unsatisfactory because they all basically suggest various blocks of "here paste this code" to convert the string. What's missing is any information about the location of internal mechanisms that already do this for PHP, so that it/they can be used directly, or at least faithfully emulated.

  • 写回答

0条回答 默认 最新

    报告相同问题?

    悬赏问题

    • ¥15 谁有desed数据集呀
    • ¥20 手写数字识别运行c仿真时,程序报错错误代码sim211-100
    • ¥15 关于#hadoop#的问题
    • ¥15 (标签-Python|关键词-socket)
    • ¥15 keil里为什么main.c定义的函数在it.c调用不了
    • ¥50 切换TabTip键盘的输入法
    • ¥15 可否在不同线程中调用封装数据库操作的类
    • ¥15 微带串馈天线阵列每个阵元宽度计算
    • ¥15 keil的map文件中Image component sizes各项意思
    • ¥20 求个正点原子stm32f407开发版的贪吃蛇游戏