mirror of
https://github.com/VueFileManager/vuefilemanager.git
synced 2026-05-18 11:15:02 +00:00
upload-limit v0.3 solved the multiple DB querys,uploadLimit in config
This commit is contained in:
@@ -365,11 +365,14 @@ function format_megabytes($megabytes)
|
||||
{
|
||||
if ($megabytes >= 1000) {
|
||||
return $megabytes / 1000 . 'GB';
|
||||
} else if ($megabytes >= 1000000) {
|
||||
return $megabytes / 1000000 . 'TB';
|
||||
}else {
|
||||
return $megabytes . 'MB';
|
||||
}
|
||||
|
||||
if ($megabytes >= 1000000) {
|
||||
return $megabytes / 1000000 . 'TB';
|
||||
}
|
||||
|
||||
return $megabytes . 'MB';
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -251,14 +251,20 @@ class Editor
|
||||
$disk_file_name = basename('chunks/' . $file->getClientOriginalName(), '.part');
|
||||
$temp_filename = $file->getClientOriginalName();
|
||||
|
||||
//File Path
|
||||
$file_path = config('filesystems.disks.local.root') . '/chunks/' . $temp_filename;
|
||||
// File Path
|
||||
$file_path = config('filesystems.disks.local.root') . '/chunks/' . $temp_filename;\
|
||||
|
||||
// Generate file
|
||||
File::append($file_path, $file->get());
|
||||
//Size of file
|
||||
|
||||
// Size of file
|
||||
$file_size = File::size($file_path);
|
||||
//File size handling
|
||||
if($file_size > format_bytes(get_setting('upload_limit')) && get_setting('upload_limit') !== null) abort(413);
|
||||
|
||||
// Size of limit
|
||||
$limit = get_setting('upload_limit');
|
||||
|
||||
// File size handling
|
||||
if( $limit && $file_size > format_bytes($limit)) abort(413);
|
||||
|
||||
// If last then process file
|
||||
if ($request->boolean('is_last')) {
|
||||
|
||||
Reference in New Issue
Block a user