Upload large files to some of the problems encountered Tencent cloud cos


  Stresses encountered a problem developed.
  Encountered in the development of a demand, the need to support video uploads in the background form page. Because the project has been using a third party to do COS Tencent cloud storage platform, so the video must be uploaded to cos save.
First thought was to use php Tencent provided SDK to do, to tie Sike documentation meal after the completion of the upload videos to cos function, but in the test ran into problems, local development testing are a few megabytes small video, upload no problem. But when you upload more than 10M of video on-line will be very long time-consuming, but is limited by the speed of the server and bandwidth limitations do not increase, the result is a timeout failure.
  Baidu adjusted maximum execution time of the script and php server cache limit, but still achieve the effect you want. After some painful struggle and finally solved it. The solution is to use the sdk direct manner js file upload stream initiated locally. After php upload mechanism because they no longer need to worry about file size is so super limit. And in the same server environment significantly improved upload speed. Meanwhile sdk upload interfaces will also upload information in a timely manner callback. Just do a simple calculation and packages can be displayed in real time and upload progress rate. Here record, hoping for the same experience this problem classmates help.

 author:zmq

 

Guess you like

Origin www.cnblogs.com/widgetbox/p/11913228.html