@@ -124,27 +124,27 @@ - (void)uploadImageToQNFilePath:(NSString *)filePath {
124
124
// }
125
125
// option:uploadOption];
126
126
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) {
141
130
// NSLog(@"info ===== %@", info);
142
131
// NSLog(@"resp ===== %@", resp);
143
132
//
144
133
// [weakSelf changeUploadState:UploadStatePrepare];
145
134
// [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];
148
148
}
149
149
150
150
- (PHAsset *)getPHAssert {
0 commit comments