dongxiz5342 2017-07-06 14:31 采纳率: 100%
浏览 94

当我发送给PHP的数据太大时,可以接收数据,而我无法使用$ _POST获取变量

Actually, I wanna send a high resolution image to PHP. I'm sure that the data have been captured, because when I use

$img=file_get_contents("php://input"); $myfile = fopen("test.txt", "w"); fwrite($myfile,$img); fclose($myfile);

I can see data in test.txt file. And the test.txt file looks like the bellowing one: enter image description here

No matter the size of my image, I can get the data I want in test.txt.
Everything is fine when image's size is in a normal range like 2MB, and I can save the image locally. But the problem is when my image is too large nothing can be gotten. I use $_POST in PHP like bellowing.

$img = $_POST["hidden_data"]; $board_company = $_POST["cbname"];

Is it because the data is so large that PHP does not have the ability to find anything? It's weird.

EDIT1:

Should I always save data as txt and then get what I what from the txt file? It's a little stupid. Incidentally, I have modified post_max_size=100M.

  • 写回答

0条回答 默认 最新

    报告相同问题?

    悬赏问题

    • ¥15 R语言Rstudio突然无法启动
    • ¥15 关于#matlab#的问题:提取2个图像的变量作为另外一个图像像元的移动量,计算新的位置创建新的图像并提取第二个图像的变量到新的图像
    • ¥15 改算法,照着压缩包里边,参考其他代码封装的格式 写到main函数里
    • ¥15 用windows做服务的同志有吗
    • ¥60 求一个简单的网页(标签-安全|关键词-上传)
    • ¥35 lstm时间序列共享单车预测,loss值优化,参数优化算法
    • ¥15 Python中的request,如何使用ssr节点,通过代理requests网页。本人在泰国,需要用大陆ip才能玩网页游戏,合法合规。
    • ¥100 为什么这个恒流源电路不能恒流?
    • ¥15 有偿求跨组件数据流路径图
    • ¥15 写一个方法checkPerson,入参实体类Person,出参布尔值