Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

任务暂停后如何继续上传呢? #7

Closed
underweather opened this issue Sep 17, 2022 · 2 comments
Closed

任务暂停后如何继续上传呢? #7

underweather opened this issue Sep 17, 2022 · 2 comments

Comments

@underweather
Copy link

underweather commented Sep 17, 2022

您好,现在遇到的一个问题是任务调用stop方法后如何继续上传。目前的实现流程是:调用stop方法后,在继续上传的方法中调用当前任务的getCheckpoint()方法获取checkPoint方法,然后直接传给createUploadTask()方法。但是报了如下错误:
TypeError: Illegal invocation
at StandardSerialUploadTask.sliceFile (BaseUploader.js:1173:24)
at StandardSerialUploadTask.upload_sequential (StandardSerialUploader.js:217:22)
at StandardSerialUploadTask.upload (StandardSerialUploader.js:167:23)
at StandardSerialUploadTask.run (BaseUploader.js:676:20)
at async StandardSerialUploadTask.doStart (BaseUploader.js:556:7)
handleError @ BaseUploader.js:287
doStart @ BaseUploader.js:563
await in doStart (async)
start @ BaseUploader.js:548
doUploadFile @ pds.ts:128
restartTask @ index.ts:146
(anonymous) @ pinia.mjs:1359
store. @ pinia.mjs:917
restartTask @ TransferItemView.vue:142
delTask @ TransferItemView.vue:126
_createElementVNode.onClick._cache.._cache. @ TransferItemView.vue:51
callWithErrorHandling @ runtime-core.esm-bundler.js:155
callWithAsyncErrorHandling @ runtime-core.esm-bundler.js:164
invoker @ runtime-dom.esm-bundler.js:370
请问是哪里非法引用呢?感谢
或者调用task的stop方法后,如何继续上传当前任务呢?

@aleelock
Copy link
Collaborator

如果是在浏览器里使用,checkpoint中的 file 必须是HTML File对象,由于浏览器的安全限制,必须由用户选择文件触发。

@aleelock
Copy link
Collaborator

替换checkpoint里面的file为HTML File,才能传入 createUploadTask()。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants