@xuda.io/drive_module 1.1.1234 → 1.1.1236
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.
- package/index.mjs +10 -2
- package/package.json +1 -1
package/index.mjs
CHANGED
|
@@ -1464,6 +1464,7 @@ export const get_drive_size = async (req) => {
|
|
|
1464
1464
|
};
|
|
1465
1465
|
|
|
1466
1466
|
const upload_file_to_spaces = async (tempPath, ref, drive_type, file_name) => {
|
|
1467
|
+
debugger;
|
|
1467
1468
|
const spacesEndpoint = new S3Client({
|
|
1468
1469
|
endpoint: _conf.storage_bucket[process.env.XUDA_HOSTNAME].endpoint,
|
|
1469
1470
|
region: _conf.storage_bucket[process.env.XUDA_HOSTNAME].region,
|
|
@@ -1476,9 +1477,16 @@ const upload_file_to_spaces = async (tempPath, ref, drive_type, file_name) => {
|
|
|
1476
1477
|
|
|
1477
1478
|
const fileContent = fs.createReadStream(tempPath);
|
|
1478
1479
|
|
|
1480
|
+
// const uploadParams = {
|
|
1481
|
+
// Bucket: `${process.env.XUDA_HOSTNAME}/${drive_type}`,
|
|
1482
|
+
// Key: path.join(ref, _utils.UUID() + '_' + file_name),
|
|
1483
|
+
// Body: fileContent,
|
|
1484
|
+
// ACL: 'public-read',
|
|
1485
|
+
// };
|
|
1486
|
+
|
|
1479
1487
|
const uploadParams = {
|
|
1480
|
-
Bucket:
|
|
1481
|
-
Key: path.join(ref, _utils.UUID() + '_' + file_name),
|
|
1488
|
+
Bucket: _conf.storage_bucket[process.env.XUDA_HOSTNAME].name,
|
|
1489
|
+
Key: path.join(process.env.XUDA_HOSTNAME, drive_type, ref, _utils.UUID() + '_' + file_name),
|
|
1482
1490
|
Body: fileContent,
|
|
1483
1491
|
ACL: 'public-read',
|
|
1484
1492
|
};
|