- $result[] = [
- $this->FILE_INFO['TEMP_NAME'],
- $this->FILE_INFO['NAME'],
- $this->FILE_INFO['SIZE'],
- $this->FILE_INFO['SHA1'],
- $this->FILE_INFO['EXTENSION'],
- $this->FILE_INFO['MIME'],
- $this->FILE_INFO['DUPE'],
- $this->FILE_INFO['FILENAME'],
- ];
+ $result[] = $FILE_INFO;
- 'hash' => $this->FILE_INFO['SHA1'],
- 'name' => $this->FILE_INFO['NAME'],
- 'filename' => $this->FILE_INFO['FILENAME'],
- 'url' => 'https://' . $this->Connector->CONFIG['FILE_DOMAIN'] . '/' . $this->FILE_INFO['FILENAME'],
- 'size' => $this->FILE_INFO['SIZE'],
- 'dupe' => $this->FILE_INFO['DUPE'],
+ 'hash' => $FILE_INFO['SHA1'],
+ 'name' => $FILE_INFO['NAME'],
+ 'filename' => $FILE_INFO['FILENAME'],
+ 'url' => 'https://' . $this->Connector->CONFIG['FILE_DOMAIN'] . '/' . $FILE_INFO['FILENAME'],
+ 'size' => $FILE_INFO['SIZE'],
+ 'dupe' => $FILE_INFO['DUPE'],
- private function lookupExtension(string $mimetype):string
- {
- $types = [
- 'image/gif' => 'gif',
- 'image/jpeg' => 'jpg',
- 'image/avif' => 'avif',
- 'image/png' => 'png',
- 'image/tiff' => 'tiff',
- 'image/vnd.wap.wbmp' => 'wbmp',
- 'image/webp' => 'webp',
- 'image/x-icon' => 'ico',
- 'image/x-jng' => 'jng',
- 'image/x-ms-bmp' => 'bmp',
- 'application/pdf' => 'pdf',
- 'application/postscript' => 'ps',
- 'application/x-7z-compressed' => '7z',
- 'application/zip' => 'zip',
- 'audio/midi' => 'mid',
- 'audio/mpeg' => 'mp3',
- 'audio/ogg' => 'ogg',
- 'audio/x-m4a' => 'm4a',
- 'audio/x-realaudio' => 'ra',
- 'video/3gpp' => '3gpp',
- 'video/mp2t' => 'ts',
- 'video/mp4' => 'mp4',
- 'video/mpeg' => 'mpeg',
- 'video/quicktime' => 'mov',
- 'video/webm' => 'webm',
- 'video/x-flv' => 'flv',
- 'video/x-m4v' => 'm4v',
- 'video/x-mng' => 'mng',
- 'video/x-ms-asf' => 'asx',
- 'video/x-ms-wmv' => 'wmv',
- 'video/x-msvideo' => 'avi',
- ];
- if (isset($types[$mimetype])) {
- return $types[$mimetype];
- } else {
- $this->Connector->response->error(400, 'Unknown MIME type. Add a file extension to your filename.');
- }
- }
+ private function lookupExtension(string $mimetype):string
+ {
+ $types = [
+ 'image/gif' => 'gif',
+ 'image/jpeg' => 'jpg',
+ 'image/avif' => 'avif',
+ 'image/png' => 'png',
+ 'image/tiff' => 'tiff',
+ 'image/vnd.wap.wbmp' => 'wbmp',
+ 'image/webp' => 'webp',
+ 'image/x-icon' => 'ico',
+ 'image/x-jng' => 'jng',
+ 'image/x-ms-bmp' => 'bmp',
+ 'application/pdf' => 'pdf',
+ 'application/postscript' => 'ps',
+ 'application/x-7z-compressed' => '7z',
+ 'application/zip' => 'zip',
+ 'audio/midi' => 'mid',
+ 'audio/mpeg' => 'mp3',
+ 'audio/ogg' => 'ogg',
+ 'audio/x-m4a' => 'm4a',
+ 'audio/x-realaudio' => 'ra',
+ 'video/3gpp' => '3gpp',
+ 'video/mp2t' => 'ts',
+ 'video/mp4' => 'mp4',
+ 'video/mpeg' => 'mpeg',
+ 'video/quicktime' => 'mov',
+ 'video/webm' => 'webm',
+ 'video/x-flv' => 'flv',
+ 'video/x-m4v' => 'm4v',
+ 'video/x-mng' => 'mng',
+ 'video/x-ms-asf' => 'asx',
+ 'video/x-ms-wmv' => 'wmv',
+ 'video/x-msvideo' => 'avi',
+ ];
+ if (isset($types[$mimetype])) {
+ return $types[$mimetype];
+ } else {
+ $this->Connector->response->error(400, 'Unknown MIME type. Add a file extension to your filename.');
+ }
+ }