@xuda.io/drive_module 1.1.1383 → 1.1.1385
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 +4 -2
- package/package.json +1 -1
package/index.mjs
CHANGED
|
@@ -1084,7 +1084,8 @@ export const upload_drive_file = async (req, job_id, headers, file_obj) => {
|
|
|
1084
1084
|
|
|
1085
1085
|
if (!validation_ret.valid) {
|
|
1086
1086
|
await fs_module.unlink(tempPath);
|
|
1087
|
-
throw new Error(`
|
|
1087
|
+
throw new Error(`File not allowed!`);
|
|
1088
|
+
// throw new Error(`Only ${_conf.allowedExts_drive.toString()} files are allowed!`);
|
|
1088
1089
|
}
|
|
1089
1090
|
|
|
1090
1091
|
let ref, file_name, target_file, save_ret;
|
|
@@ -1102,6 +1103,7 @@ export const upload_drive_file = async (req, job_id, headers, file_obj) => {
|
|
|
1102
1103
|
}
|
|
1103
1104
|
}
|
|
1104
1105
|
} catch (error) {}
|
|
1106
|
+
|
|
1105
1107
|
const ts = Date.now();
|
|
1106
1108
|
let doc = {
|
|
1107
1109
|
docType: `${drive_type}_drive`,
|
|
@@ -1114,7 +1116,7 @@ export const upload_drive_file = async (req, job_id, headers, file_obj) => {
|
|
|
1114
1116
|
ip: headers['cf-connecting-ip'],
|
|
1115
1117
|
country: headers['cf-ipcountry'],
|
|
1116
1118
|
file_ext: ext,
|
|
1117
|
-
is_archive:
|
|
1119
|
+
is_archive: validation_ret.valid && validation_ret.category === 'archive' ? true : false,
|
|
1118
1120
|
drive_type,
|
|
1119
1121
|
mime: file_obj.mimetype,
|
|
1120
1122
|
ocr_stat: ['image', 'application', 'text'].includes(file_obj.mimetype.split('/')[0]) ? 1 : 0,
|