之前上传过程中是没有任何问题的。今天突然出现这个问题:用七牛上传图片时,没有成功,确调用上传完毕的方法。如图:
这是我的方法实现:`+ (void)uploadImageToQNFilePath:(NSString )filePath AndToken:(NSString )token upSuccess:(void (^)(NSString ))success progressPercent:(void (^)(float, BOOL ))progresspercent iscancel:(void (^)(BOOL))CancelResult
{
_cancel = NO;
QNUploadManager *upManager = [[QNUploadManager alloc] init];
QNUploadOption *uploadOption = [[QNUploadOption alloc] initWithMime:nil progressHandler:^(NSString *key, float percent) {
    if (progresspercent) {
        progresspercent(percent,&_cancel);
    }
    //        NSMutableDictionary *info = [NSMutableDictionary dictionary];
//        info[YBSPicUploadProgress] = @(percent);
    
}params:nil
 checkCrc:NO
 cancellationSignal:^BOOL{
     !_cancel ?: CancelResult(YES);
     return _cancel;
 }];
[upManager putFile:filePath key:nil token:token complete:^(QNResponseInfo *info, NSString *key, NSDictionary *resp) {
    NSLog(@"info ===== %@", filePath);
    NSLog(@"key ===== %@", key);
    NSLog(@"resp ===== %@", resp);
    if (success) {
        success(resp[@"key"]);
    }
}
option:uploadOption];
}`
完全没变啊...求助
Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号
找到问题所在了....原来是后台给我的token多了个n换行字符...。希望大家引以为鉴。我是LZ