NGALLERY['root']['storage']['s3']['credentials']['region'], 'version' => NGALLERY['root']['storage']['s3']['credentials']['version'], 'credentials' => [ 'key' => NGALLERY['root']['storage']['s3']['credentials']['key'], 'secret' => NGALLERY['root']['storage']['s3']['credentials']['secret'], ], 'endpoint' => NGALLERY['root']['storage']['s3']['domains']['gateway'], ]); $s3->putObject([ 'Bucket' => NGALLERY['root']['storage']['s3']['credentials']['bucket'], 'Key' => $location.$filecdn, 'SourceFile' => $file['tmp_name'] ]); $this->type = explode('/', $file['type'])[0]; $this->src = NGALLERY['root']['storage']['s3']['domains']['public'] . '/' . $location . $filecdn; $this->size = self::human_filesize(filesize($file['tmp_name'])); $this->name = $file['name']; } public function getType() { return $this->type; } public function getSrc() { return $this->src; } public function getSize() { return $this->size; } public function getName() { return $this->name; } }