-
Notifications
You must be signed in to change notification settings - Fork 8
Open
Description
修改 ./src/service/i18nOpenapi/demo.js 的代码, 发起 ProjectTaskTargetDownload 请求:
const { defaultService } = require('../../../lib/services/i18nOpenapi');
const fs = require('fs');
async function main(AccessKeyId, SecretKey, SessionToken) {
const i18nOpenapiService = defaultService;
i18nOpenapiService.setAccessKeyId(AccessKeyId);
i18nOpenapiService.setSecretKey(SecretKey);
if (SessionToken) {
// 使用sts请求时 设置SessionToken
i18nOpenapiService.setSessionToken(SessionToken);
}
const result = await i18nOpenapiService.ProjectTaskTargetDownload({
projectId: xxx,
taskId: xxxx
});
console.log("result:", result);
fs.writeFileSync("filename.zip", result);
}解压相关 zip 包文件后显示文件内容缺失
unzip filename.zip
Archive: filename.zip
caution: zipfile comment truncated
error [filename.zip]: missing 3232541214 bytes in zipfile
(attempting to process anyway)
error [filename.zip]: attempt to seek before beginning of zipfile
(please check that you have transferred or created the zipfile in the
appropriate BINARY mode and that you have compiled UnZip properly)
这里看起来需要使用 stream 的方式去请求,需要提供一下相关实现代码和示例
Metadata
Metadata
Assignees
Labels
No labels