duanlu7680 2014-10-29 11:13
浏览 23

too long

i want to upload a local file via PHP to Google Drive. If I upload a small file (<5MB) everything is working. If I want to upload a larger file I get a "Fatal error: Maximum execution time of 30 seconds exceeded". I can set the max_execution_time in my php.ini on a very high value but it seems to be a bad solution. If I use "set_time_limit(seconds);" I can't upload more files simultaneously (I don't know why).

So my question is how to upload a large file without changing my php.ini to a bad execution time. How is that supposed to solve in PHP? I would like to use just a simple CURL cli command but that does not work with Google Drive because CURL can't support Oath.

  • 写回答

2条回答 默认 最新

  • dongwen9975 2014-10-29 11:29
    关注

    This a bad idea to use a simple PHP code to upload a very large file.

    You should use Javascript to upload large files because it's using AJAX methods. Also, it will allow you to display a progress bar.

    I did a little research. Here is some nice scripts using jQuery : http://designscrazed.org/html5-jquery-file-upload-scripts/

    Or another script which not use jQuery (I don't if it's a good one) : http://igstan.ro/posts/2009-01-11-ajax-file-upload-with-pure-javascript.html

    Good luck !

    评论

报告相同问题?

悬赏问题

  • ¥15 C++ yoloV5改写遇到的问题
  • ¥20 win11修改中文用户名路径
  • ¥15 win2012磁盘空间不足,c盘正常,d盘无法写入
  • ¥15 用土力学知识进行土坡稳定性分析与挡土墙设计
  • ¥70 PlayWright在Java上连接CDP关联本地Chrome启动失败,貌似是Windows端口转发问题
  • ¥15 帮我写一个c++工程
  • ¥30 Eclipse官网打不开,官网首页进不去,显示无法访问此页面,求解决方法
  • ¥15 关于smbclient 库的使用
  • ¥15 微信小程序协议怎么写
  • ¥15 c语言怎么用printf(“\b \b”)与getch()实现黑框里写入与删除?