chunk upload and multipart upload beta.2

This commit is contained in:
carodej
2020-07-29 16:33:42 +02:00
parent 18761eb5b3
commit 46256f6332
6 changed files with 38 additions and 20 deletions

View File

@@ -25,8 +25,8 @@ But, it can't be done without you, development is more and more complicated and
- [Get your active plans](#get-your-active-plans) - [Get your active plans](#get-your-active-plans)
- [Manage Failed Payments](#manage-failed-payments) - [Manage Failed Payments](#manage-failed-payments)
- [Tax Rates](#tax-rates) - [Tax Rates](#tax-rates)
- [Technical Informations](#technical-informations) - [Developers](#developers)
- [For Developers](#for-developers) - [Running development environment on your localhost](#running-development-environment-on-your-localhost)
- [Supported Storages](#supported-storages) - [Supported Storages](#supported-storages)
- [How to Create New Language](#how-to-create-new-language) - [How to Create New Language](#how-to-create-new-language)
- [Others](#others) - [Others](#others)
@@ -65,8 +65,15 @@ But, it can't be done without you, development is more and more complicated and
Copy project files to web root folder of your domain. It's mostly located in `html`, `www` or `public_html` folder name. Copy project files to web root folder of your domain. It's mostly located in `html`, `www` or `public_html` folder name.
Configure your web server's document / web root to point to the public directory of the software. For example, if you've uploaded the software in `example.com` folder, your web directory should be changed to `example.com/public` folder.
Make sure `.env` file was uploaded. This type of file can be hidden in default. Make sure `.env` file was uploaded. This type of file can be hidden in default.
When you download repository from GitHub, you have to rename your `.env.example` file to `.env`. Then run command below in your terminal to install vendors. Composer is required.
```
composer install
```
Set `755` permission (CHMOD) to these file and folders directory within all children subdirectories: Set `755` permission (CHMOD) to these file and folders directory within all children subdirectories:
- /bootstrap/cache - /bootstrap/cache
@@ -83,17 +90,19 @@ That was the hardest part of installation proces. Please follow instructions in
There are several PHP settings good to know to setup before you try upload any file. Please set these values in your php.ini, we provide minimal setup for you. When you set `-1` then you set infinity limits. There are several PHP settings good to know to setup before you try upload any file. Please set these values in your php.ini, we provide minimal setup for you. When you set `-1` then you set infinity limits.
``` ```
memory_limit = 128M memory_limit = 512M
upload_max_filesize = 128 upload_max_filesize = 1024M
post_max_size = 128M post_max_size = 1024M
max_file_uploads = 50 max_file_uploads = 50
max_execution_time = 1800 max_execution_time = 1800
``` ```
## Chunk Upload ## Chunk Upload
VueFileManager in default supporting chunk upload. Default chunk upload size is `128MB`. If you wish change this default value, go to `/config/vuefilemanager.php` and change `chunk_size` attribute. VueFileManager in default supporting chunk upload. Default chunk upload size is `128MB`. If you wish change this default value, go to `/config/vuefilemanager.php` and change `chunk_size` attribute.
if you use external storage, and upload large files, to prevent failing upload process make sure you have enough space in your application space. if you use external storage, and upload large files, to prevent failing upload process make sure you have enough space in your application space.
## Nginx Configuration ## Nginx Configuration
If you running VueFileManager undex Nginx, don't forget set this value in your `nginx.conf` file: If you running VueFileManager undex Nginx, don't forget set this value in your `nginx.conf` file:
``` ```
@@ -201,11 +210,15 @@ You are able to manage tax rates. When adding a new tax rate, if no Region is sp
Just log in to your stripe dashboard, and you will find taxes under `Dashboard / Products / Tax Rates`. Just log in to your stripe dashboard, and you will find taxes under `Dashboard / Products / Tax Rates`.
# Technical Informations # Developers
## For Developers ## Running development environment on your localhost
Installation process on your localhost is the same. But, there are some good hints.
After successfully installation with setup wizard, you have to set your `APP_ENV` to local mode, in default, it's in production mode. When you download repository from GitHub, you have to rename your `.env.example` file to `.env`. Then run command below in your terminal to install vendors. Composer is required.
```
composer install
```
Set your `APP_ENV` to local mode, in default, it's in production mode.
``` ```
APP_ENV=local APP_ENV=local
``` ```
@@ -215,21 +228,22 @@ Also, to debug application, set `APP_DEBUG` on true:
APP_DEBUG=true APP_DEBUG=true
``` ```
To start server on your localhost, run this command To start server on your localhost, run command below. Then go to your generated localhost URL by terminal, and follow Setup Wizard steps to configure VueFileManager.
``` ```
php artisan serve php artisan serve
``` ```
To develop your front-end, you have to install npm modules by this command:
To develop your Vue front-end, you have to install npm modules by this command:
``` ```
npm install npm install
``` ```
To compiles and hot-reloads for development. Then run this command: To compiles and hot-reloads for front-end development. Then run this command:
``` ```
npm run hot npm run hot
``` ```
To compiles for production, run this command To compiles for production build, run this command
``` ```
npm run prod npm run prod
``` ```

View File

@@ -314,7 +314,7 @@ class Editor
if (!$file) continue; if (!$file) continue;
// Get file size // Get file size
$filesize = $disk_local->size('file-manager/' . $filename); $filesize = $disk_local->size('file-manager/' . $file);
// If file is bigger than 5.2MB then run multipart upload // If file is bigger than 5.2MB then run multipart upload
if ($filesize > 5242880) { if ($filesize > 5242880) {
@@ -353,7 +353,7 @@ class Editor
} else { } else {
// Stream file object to s3 // Stream file object to s3
Storage::putFileAs('/file-manager', storage_path() . '/app/file-manager/' . $file, $file, 'private'); Storage::putFileAs('file-manager', storage_path() . '/app/file-manager/' . $file, $file, 'private');
} }
// Delete file after upload // Delete file after upload

2
public/js/main.js vendored

File diff suppressed because one or more lines are too long

View File

@@ -114,13 +114,13 @@ const Helpers = {
// Set Data // Set Data
let formData = new FormData(), let formData = new FormData(),
uploadedSize = 0, uploadedSize = 0,
isNotGeneralError = true isNotGeneralError = true,
filename = Array(16).fill(0).map(x => Math.random().toString(36).charAt(2)).join('') + '-' + file.name + '.part'
do { do {
let isLast = chunks.length === 1, let isLast = chunks.length === 1,
chunk = chunks.shift(), chunk = chunks.shift(),
attempts = 0, attempts = 0
filename = Array(16).fill(0).map(x => Math.random().toString(36).charAt(2)).join('') + '-' + file.name + '.part'
// Set form data // Set form data
formData.set('file', chunk, filename); formData.set('file', chunk, filename);

View File

@@ -94,6 +94,10 @@
this.$refs.verifyPurchaseCode.setErrors({ this.$refs.verifyPurchaseCode.setErrors({
'Purchase Code': ['Purchase code is invalid.'] 'Purchase Code': ['Purchase code is invalid.']
}); });
} else if (error.response.status == 404) {
this.$refs.verifyPurchaseCode.setErrors({
'Purchase Code': ['You may have misconfigured the app, please read the readme file and try it again.']
});
} else { } else {
this.$refs.verifyPurchaseCode.setErrors({ this.$refs.verifyPurchaseCode.setErrors({
'Purchase Code': ['Something is wrong. Please try again.'] 'Purchase Code': ['Something is wrong. Please try again.']

View File

@@ -15,7 +15,7 @@
.error-message { .error-message {
position: absolute; position: absolute;
left: 0; left: 0;
bottom: -25px; top: 50px;
} }
} }
} }