Skip to content

Commit b3b4443

Browse files
committed
Merge pull request #16 from longbai/mimeType
fixed mkfile mimetype invalid
2 parents a34b47f + af89821 commit b3b4443

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

QiniuSDK/Storage/QNResumeUpload.m

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -290,7 +290,7 @@ - (void)makeFile:(NSString *)uphost
290290
mime = @"";
291291
}
292292
else {
293-
mime = [[NSString alloc] initWithFormat:@"/mimetype/%@", [QNUrlSafeBase64 encodeString:self.option.mimeType]];
293+
mime = [[NSString alloc] initWithFormat:@"/mimeType/%@", [QNUrlSafeBase64 encodeString:self.option.mimeType]];
294294
}
295295

296296
__block NSString *url = [[NSString alloc] initWithFormat:@"http://%@/mkfile/%u%@", uphost, (unsigned int)self.size, mime];

QiniuSDK/Storage/QNUploadManager.m

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -105,10 +105,10 @@ - (void)putData:(NSData *)data
105105
[parameters addEntriesFromDictionary:option.params];
106106
}
107107

108-
NSString *mimeType = option.mimeType;
108+
NSString *mimeType = @"application/octet-stream";
109109

110-
if (!mimeType) {
111-
mimeType = @"application/octet-stream";
110+
if (option && option.mimeType) {
111+
mimeType = option.mimeType;
112112
}
113113

114114
if (option && option.checkCrc) {

0 commit comments

Comments
 (0)