mirror of
https://github.com/claradex/nativegallery.git
synced 2024-12-22 16:41:04 +03:00
add directive cloudflare-bypass
If video size larger of 90 mb, they uploads to local server
This commit is contained in:
parent
e65d3402d2
commit
beaf493cb6
2 changed files with 15 additions and 1 deletions
|
@ -41,6 +41,20 @@ class Upload
|
|||
|
||||
if (strtolower (NGALLERY['root']['storage']['type']) == "s3")
|
||||
{
|
||||
if (NGALLERY['root']['video']['upload']['cloudflare-bypass'] === true) {
|
||||
if ($location === 'cdn/video') {
|
||||
if (filesize($_SERVER['DOCUMENT_ROOT'].'/'.$location.$filecdn) >= 94371840) {
|
||||
mkdir("{$_SERVER['DOCUMENT_ROOT']}/uploads/{$location}", 0777, true);
|
||||
move_uploaded_file ($tmpname, "{$_SERVER['DOCUMENT_ROOT']}/uploads/{$folder}");
|
||||
|
||||
$this->type = $type;
|
||||
$this->src = "/uploads/{$folder}";
|
||||
$this->size = self::human_filesize(filesize($tmpname));
|
||||
$this->name = $name;
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
$s3 = new \Aws\S3\S3Client([
|
||||
'region' => NGALLERY['root']['storage']['s3']['credentials']['region'],
|
||||
'version' => NGALLERY['root']['storage']['s3']['credentials']['version'],
|
||||
|
|
Loading…
Reference in a new issue