Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

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

Open
@holiny

Description

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,并没有将相对路径转成完整路径,导致崩溃

希望尽快解决

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

        AltStyle によって変換されたページ (->オリジナル) /