使用jQuery文件上传上传1GB到2GB的大文件 - blueimp(基于Ajax)php / yii在Firefox浏览器中显示错误 [英] upload a large file over 1GB to 2GB using jQuery File Upload - blueimp (Ajax based) php / yii it showing error in Firefox Browser

查看:253
本文介绍了使用jQuery文件上传上传1GB到2GB的大文件 - blueimp(基于Ajax)php / yii在Firefox浏览器中显示错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我尝试使用 jQuery File上传一个大于 1GB 2GB 的大文件上传 - blueimp (基于Ajax) php / yii框架1.15 我已经设置了这些值来上传大文件

pre $ memory $ limit $ 2048M $ b $ upload_max_filesize =

设置会话时间

  ini_set('session。 gc_maxlifetime',7200); 

我测试小于 1GB 文件上传成功



当我尝试上传大于 1GB 文件时,显示上传时间为50分钟后出现Forbidden错误。 。

服务器规格


  • 机器,由于它不是生产,所以我们只用code> 1CPU 和 1GB内存,64位



文件上传工作在 Google Chrome Microsoft当我上传 Mozilla Firefox 小于300MB的文件时,它已经成功上传,但当我我试图哟上传大于300MB的文件一段时间后,Ajax调用失败,并给 500内部服务器错误
标题响应是在下面的图像
。 jQuery的文件上传支持。


它将文件分成具有预定义块大小的较小片段,然后逐个上传。另一个好处是你可以恢复文件上传。如果上传被中断,则无需再次上传整个文件。此外,它可以克服您的 upload_max_filesize post_max_size 问题。


I am trying to upload a large file over 1GB to 2GB using jQuery File Upload - blueimp (Ajax based) php / yii Framework 1.15 i have set these values to upload larger file

memory_limit = 2048M
upload_max_filesize = 2048M 
post_max_size = 2048M 

Session time set

ini_set('session.gc_maxlifetime', 7200);

I test lesser than 1GB file that is uploading successfully

when I am trying to upload larger than 1GB file it shows Forbidden error after 50mins uploading time...

Server Specifications

  • it's a virtual machine, and due to it's not production yet so we only using 1CPU and 1GB memory, 64bit

File uploading is working in Google Chromeand Microsoft Edge(I have tested with 1.15 and 1.88 GB file) when I am uploading file in Mozilla Firefox less than 300MB it is uploading successfully but when I am trying yo upload greater than 300MB file after some time Ajax call is fails and give 500 Internal Server Error header response is in below image

解决方案

When you upload files having size more than 100 MB, better go for chunked file uploads. jQuery-File-Upload supports that.

It splits files into smaller fragments with predefined chunk size and upload them one by one. Another advantage is that you can resume file uploads. No need to upload entire file again, if the upload is interrupted. Also it can overcome your upload_max_filesize and post_max_size issue.

这篇关于使用jQuery文件上传上传1GB到2GB的大文件 - blueimp(基于Ajax)php / yii在Firefox浏览器中显示错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆