pangea-server 3.3.146 → 3.3.147
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -55,6 +55,8 @@ class FileStorage {
|
|
|
55
55
|
static async UploadFile(file, folder, previousFile) {
|
|
56
56
|
if (previousFile)
|
|
57
57
|
await this.DeleteFile(previousFile);
|
|
58
|
+
if (Buffer.isBuffer(file))
|
|
59
|
+
return uploadFile(file, { folder, fileType: 'application/octet-stream' });
|
|
58
60
|
if (typeof file === 'string') {
|
|
59
61
|
const buffer = await promises_1.default.readFile(path_1.default.join(process.cwd(), file));
|
|
60
62
|
return uploadFile(buffer, { folder, fileType: 'application/octet-stream' });
|