mirror of
https://github.com/claradex/nativegallery.git
synced 2025-04-01 06:04:07 +03:00
parent
2ec7b5c61a
commit
b7112238c3
1 changed files with 33 additions and 19 deletions
|
@ -38,6 +38,9 @@ class Upload
|
||||||
$cstrong = True;
|
$cstrong = True;
|
||||||
$filecdn = bin2hex(openssl_random_pseudo_bytes(64, $cstrong)) . '.' . $fileext;
|
$filecdn = bin2hex(openssl_random_pseudo_bytes(64, $cstrong)) . '.' . $fileext;
|
||||||
$folder = $location . $filecdn;
|
$folder = $location . $filecdn;
|
||||||
|
|
||||||
|
if (strtolower (NGALLERY['root']['storage']['type']) == "s3")
|
||||||
|
{
|
||||||
$s3 = new \Aws\S3\S3Client([
|
$s3 = new \Aws\S3\S3Client([
|
||||||
'region' => NGALLERY['root']['storage']['s3']['credentials']['region'],
|
'region' => NGALLERY['root']['storage']['s3']['credentials']['region'],
|
||||||
'version' => NGALLERY['root']['storage']['s3']['credentials']['version'],
|
'version' => NGALLERY['root']['storage']['s3']['credentials']['version'],
|
||||||
|
@ -58,6 +61,17 @@ class Upload
|
||||||
$this->size = self::human_filesize(filesize($tmpname));
|
$this->size = self::human_filesize(filesize($tmpname));
|
||||||
$this->name = $name;
|
$this->name = $name;
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
@mkdir ("{$_SERVER['DOCUMENT_ROOT']}/uploads/{$location}");
|
||||||
|
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;
|
||||||
|
}
|
||||||
|
}
|
||||||
public function getType()
|
public function getType()
|
||||||
{
|
{
|
||||||
return $this->type;
|
return $this->type;
|
||||||
|
|
Loading…
Reference in a new issue