ios端token获取正常也没有过期,但是总是在进度95%的时候回调401

NSDictionary *dic  = @{@"x:userid"    :USERID_String,
                                              @"x:username"  :[AppDelegate userName],
                                              @"x:caseguid"  :obj.barcode,
                                              @"x:itemid"    :[NSString stringWithFormat:@"%d",[[fileDic objectForKey:@"selectedIndex"] intValue]+1],
                                              @"x:barcode"   :obj.barcode,
                                              @"x:filename"  :fileReName,
                                              @"x:fileremark":@" ",
                                              @"x:filetype"  :i2s(fileType),
                                              @"x:usertoken" :[AppDelegate userToken],
                                              @"x:patdetail" :json,
                                              @"x:identify"  :@"0",
                                              @"x:picguid"   :fileReName
                                              };
                 NSLog(@"dic : %@",dic);
                       NSString *filePath = [m_AppDelegate.documentPath stringByAppendingPathComponent:[[fileDic objectForKey:@"video"] lastPathComponent] ];
                       QNUploadManager * up =  [QNUploadManager sharedInstanceWithRecorder:nil recorderKeyGenerator:nil];

                       QNUploadOption *option = [[QNUploadOption alloc ]initWithMime:nil progressHandler:^(NSString *key, float percent) {
                           NSLog(@"key:%@ percent  %f",key,percent);
                       } params:dic checkCrc:YES cancellationSignal:nil];

                   [up putFile:filePath key:fileReName token:qiniuToken complete:^(QNResponseInfo *info, NSString *key, NSDictionary *resp) {
                       NSLog(@"info %@  key %@ resp %@",info,key,resp);
                       //NSLog(@"完成");
                   } option:option];
                   }];

请求回调

2014-12-23 11:09:46.572 zhenlipain[433:118722] key:3688_3C33D180-9E61-4D54-875E-33767F60D9AF_0E9ED74C-CA38-4B9E-BD69-AF84BB9A21F8.jpg percent  0.950000
2014-12-23 11:09:46.973 zhenlipain[433:118722] info <QNResponseInfo: 0x18118520, status: 401, requestId: KWEAAHyDAxujYbIT, xlog: UP/401, error: Error Domain=qiniu.com Code=401 "The operation couldn’t be completed. (qiniu.com error 401.)" UserInfo=0x18110520 {error=bad auth}>  key 3688_3C33D180-9E61-4D54-875E-33767F60D9AF_0E9ED74C-CA38-4B9E-BD69-AF84BB9A21F8.jpg resp (null)
阅读 3.5k
2 个回答

问题已经定位 是 自定义变量出现空字符串,造成出现//路径,nginx 前端做了一次跳转 变成了 /, 然后出现了失败,现在已经修正,请更新sdk 到7.0.7 版本

你尝试一下你在服务端生成的token在服务端能否正常上传,token错误有可能是token的生成过程有问题。

撰写回答
你尚未登录,登录后可以
  • 和开发者交流问题的细节
  • 关注并接收问题和回答的更新提醒
  • 参与内容的编辑和改进,让解决方法与时俱进