douyong1974 2010-05-05 12:44
浏览 218
已采纳

如何在php中动态更改最大上传文件限制?

I want to change the max upload file limit dynamically. means by not changing the php.ini file on server.
Whenever user had uploaded more then 2 mb then my upload limit should be change.
I want to do all this through php.

Thanks in advance.

  • 写回答

3条回答 默认 最新

  • dos71253 2010-05-05 12:47
    关注

    Try this:

    ini_set('upload_max_filesize', your_value_here);
    

    Make sure also that you have specified the correct acceptable settings for:

    • file_uploads
    • upload_max_filesize
    • max_input_time
    • memory_limit
    • max_execution_time
    • post_max_size
    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(2条)

报告相同问题?

悬赏问题

  • ¥15 求解 yolo算法问题
  • ¥15 虚拟机打包apk出现错误
  • ¥30 最小化遗憾贪心算法上界
  • ¥15 用visual studi code完成html页面
  • ¥15 聚类分析或者python进行数据分析
  • ¥15 逻辑谓词和消解原理的运用
  • ¥15 三菱伺服电机按启动按钮有使能但不动作
  • ¥15 js,页面2返回页面1时定位进入的设备
  • ¥50 导入文件到网吧的电脑并且在重启之后不会被恢复
  • ¥15 (希望可以解决问题)ma和mb文件无法正常打开,打开后是空白,但是有正常内存占用,但可以在打开Maya应用程序后打开场景ma和mb格式。