diff --git a/app/Controllers/Api/Images/Upload.php b/app/Controllers/Api/Images/Upload.php index 5337c4d..c343eaa 100644 --- a/app/Controllers/Api/Images/Upload.php +++ b/app/Controllers/Api/Images/Upload.php @@ -98,7 +98,7 @@ class Upload imagejpeg($background, $outputImagePath, 90); imagedestroy($background); imagedestroy($overlay); - + $upload = new UploadPhoto($outputImagePath, 'cdn/img/'); self::$vidpreview = $upload->getSrc(); $upload = new UploadPhoto($mp4File, 'cdn/video/'); diff --git a/app/Services/Upload.php b/app/Services/Upload.php index b316471..d4eaf49 100644 --- a/app/Services/Upload.php +++ b/app/Services/Upload.php @@ -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'],