Home >Backend Development >PHP Tutorial >Video upload - Use PHP to upload videos to Alibaba Cloud oss ​​cloud server. Because the video is too large, the server will time out. How should I solve it?

Video upload - Use PHP to upload videos to Alibaba Cloud oss ​​cloud server. Because the video is too large, the server will time out. How should I solve it?

WBOY
WBOYOriginal
2016-10-17 09:30:044576browse

The company system needs to implement a video upload function to upload local videos to oss. It is based on the yii2 framework of PHP. If I use the ordinary file upload method, the server request always times out because the video file is too large. How can I solve this problem? What

Reply content:

The company system needs to implement a video upload function to upload local videos to oss. It is based on the yii2 framework of PHP. If I use the ordinary file upload method, the server request always times out because the video file is too large. How can I solve this problem? What

Use the multi-part upload function of OSS and upload directly to Alibaba Cloud in the background instead of in the browser after the upload is successful.

And the speed of Alibaba Cloud's intranet connection to OSS is still good. It has been tested that a 500M file can be completed in two to three seconds.

Refer to this class
https://github.com/Rozbo/AliyunOSS-Driver-For-ThinkPHP3.2.X
Or you can use step-by-step upload, first upload to the server, and then synchronize to OSS.
Use
https://github.com/Rozbo/Huploadify ajax upload in the frontend and synchronize in the background.

Multi-point simultaneous transmission + interrupted transmission.

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn