@@ -124,27 +124,27 @@ - (void)uploadImageToQNFilePath:(NSString *)filePath {
124124// }
125125// option:uploadOption];
126126
127- long long fileSize = [[[NSFileManager defaultManager ] attributesOfItemAtPath: filePath error: nil ] fileSize ];
128- NSInputStream *stream = [NSInputStream inputStreamWithFileAtPath: filePath];
129- [upManager putInputStream: stream sourceId: filePath.lastPathComponent size: fileSize fileName: filePath.lastPathComponent key: key token: self .token complete: ^(QNResponseInfo *info, NSString *key, NSDictionary *resp) {
130- NSLog (@" info ===== %@ " , info);
131- NSLog (@" resp ===== %@ " , resp);
132-
133- [weakSelf changeUploadState: UploadStatePrepare];
134- [weakSelf alertMessage: info.message];
135- } option: uploadOption];
136-
137- // NSURL *url = [NSURL fileURLWithPath:filePath];
138- // PHFetchResult *fetchResult = [PHAsset fetchAssetsWithALAssetURLs:@[url] options:nil];
139- // PHAsset *asset = [self getPHAssert];
140- // [upManager putPHAsset:asset key:key token:self.token complete:^(QNResponseInfo *info, NSString *key, NSDictionary *resp) {
127+ // long long fileSize = [[[NSFileManager defaultManager] attributesOfItemAtPath:filePath error:nil] fileSize];
128+ // NSInputStream *stream = [NSInputStream inputStreamWithFileAtPath:filePath];
129+ // [upManager putInputStream:stream sourceId:filePath.lastPathComponent size:fileSize fileName:filePath.lastPathComponent key:key token:self.token complete:^(QNResponseInfo *info, NSString *key, NSDictionary *resp) {
141130// NSLog(@"info ===== %@", info);
142131// NSLog(@"resp ===== %@", resp);
143132//
144133// [weakSelf changeUploadState:UploadStatePrepare];
145134// [weakSelf alertMessage:info.message];
146- // }
147- // option:uploadOption];
135+ // } option:uploadOption];
136+
137+ NSURL *url = [NSURL fileURLWithPath: filePath];
138+ PHFetchResult *fetchResult = [PHAsset fetchAssetsWithALAssetURLs: @[url] options: nil ];
139+ PHAsset *asset = [self getPHAssert ];
140+ [upManager putPHAsset: asset key: key token: self .token complete: ^(QNResponseInfo *info, NSString *key, NSDictionary *resp) {
141+ NSLog (@" info ===== %@ " , info);
142+ NSLog (@" resp ===== %@ " , resp);
143+
144+ [weakSelf changeUploadState: UploadStatePrepare];
145+ [weakSelf alertMessage: info.message];
146+ }
147+ option: uploadOption];
148148}
149149
150150- (PHAsset *)getPHAssert {
0 commit comments