ios - 七牛上传图片过程中,会自动终止?
PHPz
PHPz 2017-04-18 09:33:32
0
1
266

之前上传过程中是没有任何问题的。今天突然出现这个问题:用七牛上传图片时,没有成功,确调用上传完毕的方法。如图:

这是我的方法实现:`+ (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];

}`
完全没变啊...求助

PHPz
PHPz

学习是最好的投资!

全部回复(1)
伊谢尔伦

找到问题所在了....原来是后台给我的token多了个n换行字符...。希望大家引以为鉴。我是LZ

热门教程
更多>
最新下载
更多>
网站特效
网站源码
网站素材
前端模板