Home  >  Article  >  PHP Framework  >  Video upload process using AetherUpload

Video upload process using AetherUpload

藏色散人
藏色散人forward
2019-09-28 17:18:334395browse

Description

AetherUpload is a laravel extension package that provides large file upload, with percentage progress display, support for resumed uploads, and custom middleware. Developed based on laravel 5.

We know that in the past, file uploading used to directly upload the entire file. This method is no problem for some small files. When large files need to be uploaded, this method is not only cumbersome to operate and requires modification of the configuration of the web server and back-end language, but also takes up a large amount of server memory, causing server memory shortage. In severe cases, the transmission times out or the file is too large to be uploaded. . Obviously, the ordinary file upload method can no longer meet the increasingly higher requirements. \

With the development of technology, we can now use HTML5's chunked upload technology to easily solve this problem. By dividing large files into small pieces, upload them one by one and then put them back together, we can reduce the server memory usage and break through The upload size limit in the server and back-end language configuration allows files of any size to be uploaded. It also simplifies the operation and provides an intuitive progress display. I am laravel version 5.7.

Usage

0) Switch to the root directory of your laravel project in the terminal and execute composer require peinhu/aetherupload-laravel dev-master

1) Add a line Peinhu\AetherUpload\AetherUploadServiceProvider::class,

2 in the providers array of config/app.php 2) Execute php artisan vendor:publish to publish some files and directories

3 ) Grant the corresponding permissions to the upload directory. In the project root directory, execute chmod 755 storage/app/uploads -R

4) Access http://domain name/aetherupload in the browser to reach the sample page

Tip: Please edit config/aetherupload.php to change related configuration options.

After successful installation, copy the code to the page that needs to be uploaded

Video upload process using AetherUpload

Video upload process using AetherUpload

Tips: Code path\vendor\peinhu \aetherupload-laravel\views\example.blade.php

Upload error AetherUpload\UploadController::validate does not exist, AetherUpload\UploadController::validate does not exist

Because the UploadController.php file has validate Verify, verify some necessary parameters for uploaded files/videos

Video upload process using AetherUpload

Video upload process using AetherUpload

I commented out the

file path\vendor \peinhu\aetherupload-laravel\src\UploadController.php

The file/video upload path is under \storage\app, and I want to upload it to \storage\app\public

needs to be changed A file (file name PartialResource.php)

The first change is as follows

Video upload process using AetherUpload

##The second change is as follows

Video upload process using AetherUpload

File path\vendor\peinhu\aetherupload-laravel\src\PartialResource.php

Create a soft link for storage

Command php artisan storage:link

Accessing the public/storage folder can directly access the video/file upload path, that is, \storage\app\public folder

For more Laravel related technical articles, please visit

Laravel Framework Getting Started Tutorial Column for learning!

The above is the detailed content of Video upload process using AetherUpload. For more information, please follow other related articles on the PHP Chinese website!

Statement:
This article is reproduced at:learnku.com. If there is any infringement, please contact admin@php.cn delete