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

上传本地文件,暂停后,恢复上传时崩溃,重要!! #43

Open
holiny opened this issue Dec 27, 2021 · 1 comment
Open

Comments

@holiny
Copy link

holiny commented Dec 27, 2021

Terminating app due to uncaught exception 'com.tencent.qcloud.error', reason: '不支持该路径下的文件续传:/testvideo.mp4'
terminating with uncaught exception of type NSException

查看一下上传逻辑,发现[uploadRequest cancelByProductingResumeData:&error]返回的Data中的body经过相对路径处理:
NSURL *url = (NSURL *)self.body;
QCloudUniversalPath *universalPath = [QCloudUniversalPathFactory universalPathWithURL:url];
self.body = universalPath;

但是恢复上传时
QCloudCOSXMLUploadObjectRequest *resumeRequest = [QCloudCOSXMLUploadObjectRequest requestWithRequestData:self.uploadResumeData];

源码中:
QCloudUniversalPath *path = request.body;
// fileURLWithPath会再次编码,所以需要一次解码
NSString *bodyUrl = QCloudURLDecodeUTF8([path fileURL].absoluteString);
request.body = [NSURL URLWithString:bodyUrl];
直接使用了bodyUrl,并没有将相对路径转成完整路径,导致崩溃

希望尽快解决

@wangbo1185742894
Copy link
Contributor

上传的文件来源是哪里?相册、沙盒、还是Bundle?

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