php://input 得不到数据的问题

探讨了PHP中php://input流的使用限制,尤其是在处理enctype='multipart/form-data'类型的POST请求时的问题。该文指出,在这种情况下,php://input无法作为读取原始请求体数据的有效方式,并推荐了替代方案。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

php://input 获取数据流不支持 enctype="multipart/form-data" 参数,check here.

 

php://input is a read-only stream that allows you to read raw data from the request body. In the case of POST requests, it is preferable to use php://input instead of $HTTP_RAW_POST_DATA as it does not depend on special php.ini directives. Moreover, for those cases where $HTTP_RAW_POST_DATA is not populated by default, it is a potentially less memory intensive alternative to activating always_populate_raw_post_dataphp://inputis not available with enctype="multipart/form-data".

转载于:https://my.oschina.net/swingcoder/blog/2872785

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值