dongzhuo7291 2016-03-13 23:32 采纳率: 100%
浏览 183

move_uploaded_file无法使用“更大”的文件

I have a webpage that allows users to upload a profile picture.
All is working with jpgs until a size of around 2MBs. Larger files wont be uploaded into tmp, though.

So I checked some settings:

echo 'post_max_size = ' . ini_get('post_max_size') . "
";
echo 'memory_limit = ' . ini_get('memory_limit') . "
";
// results in:
post_max_size = 8M
memory_limit = 128M

So that should not be the problem.

Also I checked that the file is actually sent via ajax, but the request headers include Content-Length:2904576, so I assume the file (with 2.9MB) is actually sent. Furthermore I have this in the request payload:
Content-Disposition: form-data; name="file"; filename="bg.jpg" Content-Type: image/jpeg

For smaller files I can see the tmp file appearing shortly in the tmp folder of my php installation - NOT for the failing larger files.

Which means something in between is blocking the files from beeing uploaded.

Does anybody have an idea what else I could check?

ConfigInfo: local php 5.4 on local webserver (EasyPHP DevServer 14.1.VC11)

  • 写回答

1条回答 默认 最新

  • douluan8828 2018-10-16 20:22
    关注

    I had a similar issue, you must increase the value of both variables in php.ini (post_max_size and upload_max_filesize)

    评论

报告相同问题?

悬赏问题

  • ¥15 微信小程序协议怎么写
  • ¥15 c语言怎么用printf(“\b \b”)与getch()实现黑框里写入与删除?
  • ¥20 怎么用dlib库的算法识别小麦病虫害
  • ¥15 华为ensp模拟器中S5700交换机在配置过程中老是反复重启
  • ¥15 java写代码遇到问题,求帮助
  • ¥15 uniapp uview http 如何实现统一的请求异常信息提示?
  • ¥15 有了解d3和topogram.js库的吗?有偿请教
  • ¥100 任意维数的K均值聚类
  • ¥15 stamps做sbas-insar,时序沉降图怎么画
  • ¥15 买了个传感器,根据商家发的代码和步骤使用但是代码报错了不会改,有没有人可以看看