佛缘书法_个人页

个人头像照片 佛缘书法
个人头像照片
0
6
0

个人介绍

暂无个人介绍

擅长的技术

获得更多能力
通用技术能力:

暂时未有相关通用技术能力~

云产品技术能力:

暂时未有相关云产品技术能力~

阿里云技能认证

详细说明
  • 提交了问题 2016-09-27

    OSS私有图片如何获取缩略图?

  • 提交了问题 2016-09-19

    OSS 私有图片缩放问题

  • 提交了问题 2016-01-14

    IOS 使用FederationToken上传文件, 未得到 tokenSTS 上传文件却不报错

  • 提交了问题 2015-10-05

    STSFederationToken过期时间不起作用

暂无更多信息
正在加载, 请稍后...
暂无更多信息
  • 提交了问题 2016-09-27

    OSS私有图片如何获取缩略图?

  • 提交了问题 2016-09-19

    OSS 私有图片缩放问题

  • 提交了问题 2016-01-14

    IOS 使用FederationToken上传文件, 未得到 tokenSTS 上传文件却不报错

  • 回答了问题 2016-01-14

    IOS 使用FederationToken上传文件, 未得到 tokenSTS 上传文件却不报错

    ReIOS 使用FederationToken上传文件, 未得到 tokenSTS 上传文件却不报错 credentialProvider 构造代码: +(void)initOSSClient {             id credential2 = [[OSSFederationCredentialProvider alloc] initWithFederationTokenGetter:^OSSFederationToken * {         NSURL * url = [NSURL URLWithString:@'http://192.168.0.100:8080/xxx/];         NSURLRequest * request = [NSURLRequest requestWithURL:url];         OSSTaskCompletionSource * tcs = [OSSTaskCompletionSource taskCompletionSource];         NSURLSession * session = [NSURLSession sharedSession];         NSURLSessionTask * sessionTask = [session dataTaskWithRequest:request                                                     completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {                                                         if (error) {                                                             [tcs setError:error];                                                             return;                                                         }                                                         [tcs setResult:data];                                                     }];         [sessionTask resume];         [tcs.task waitUntilFinished];         if (tcs.task.error) {             NSLog(@'get token error: %@', tcs.task.error);             return nil;         } else {             NSDictionary * object = [NSJSONSerialization JSONObjectWithData:tcs.task.result                                                                     options:kNilOptions                                                                       error:nil];             OSSFederationToken * token = [OSSFederationToken new];             NSDictionary *tempobject=[object objectForKey:@'Federation'];             token.tAccessKey = [tempobject objectForKey:@'accesskeyid'];             token.tSecretKey = [tempobject objectForKey:@'accesskeysecret'];             token.tToken = [tempobject objectForKey:@'securitytoken'];             token.expirationTimeInGMTFormat = [tempobject objectForKey:@'expiration'];             NSLog(@'get token: %@', token);             //2015-11-03T08:51:05Z             return token;         }     }];               OSSClientConfiguration * conf = [OSSClientConfiguration new];     conf.maxRetryCount = 2;     conf.timeoutIntervalForRequest = 30;     conf.timeoutIntervalForResource = 24 * 60 * 60;          client = [[OSSClient alloc] initWithEndpoint:endPoint credentialProvider:credential2 clientConfiguration:conf]; } ------------------------- ReIOS 使用FederationToken上传文件, 未得到 tokenSTS 上传文件却不报错 // 同步批量上传代码 + (void)uploadBatchSyncByname: (NSString*) bucketname :(NSMutableArray *) uploadarray : (int) pictype  :(NSString*)todir uploadstatusblock:(void(^) (int ))handle; {     NSString *tempdir;     tempdir=NSTemporaryDirectory();     int uploadresult; //上传状态 0:有文件上传失败 1:上传成功     uploadresult=1;     if (!client )     {         [OSSTools initOSSClient];     }                  //循环上传文件     for (int i=0; i    {                  OSSPutObjectRequest * put = [OSSPutObjectRequest new];                  // required fields         put.bucketName = bucketname;         put.objectKey = [uploadarray objectAtIndex:i];         NSString *photoname=[put.objectKey lastPathComponent];         put.uploadingFileURL = [NSURL fileURLWithPath:[tempdir stringByAppendingPathComponent:photoname]];                  // optional fields         put.uploadProgress = ^(int64_t bytesSent, int64_t totalByteSent, int64_t totalBytesExpectedToSend) {             NSLog(@'%lld, %lld, %lld', bytesSent, totalByteSent, totalBytesExpectedToSend);         };         put.contentType = @'';         put.contentMd5 = @'';         put.contentEncoding = @'';         put.contentDisposition = @'';                  OSSTask * putTask = [client putObject:put];                  [putTask waitUntilFinished]; // 阻塞直到上传完成                  if (!putTask.error) {                        NSLog(@'upload 文件 %d success!',i);             //上传成功,将文件                      NSString *sourcepath=[ tempdir stringByAppendingPathComponent:photoname] ;             NSString *topath=[todir stringByAppendingPathComponent:photoname];             [FileTools copyFile:sourcepath toPath: topath];         } else {                          NSLog(@'upload 文件 %d failed, error: %@' ,i, putTask.error);             uploadresult=0;              break;            }              }     //回调返回上传状态     handle(uploadresult);     }      ------------------------- ReIOS 使用FederationToken上传文件, 未得到 tokenSTS 上传文件却不报错 1.看这log ,就是无法得到 token报错 :get token error: 2. 但是上传时却显示成功,因为 task.error为空   if (!putTask.error) {                          NSLog(@'upload 文件 %d success!',i);             //上传成功,将文件 2016-01-14 17:48:55.363 ReleaseLife[1813:776631] get token error: Error Domain=NSURLErrorDomain Code=-1001 '请求超时。' UserInfo={NSUnderlyingError=0x15648fd30 {Error Domain=kCFErrorDomainCFNetwork Code=-1001 '(null)' UserInfo={_kCFStreamErrorCodeKey=-2102, _kCFStreamErrorDomainKey=4}}, NSErrorFailingURLStringKey=http://192.168.0.100:8080/xxx, NSErrorFailingURLKey=http://192.168.0.100:8080/xxx, _kCFStreamErrorDomainKey=4, _kCFStreamErrorCodeKey=-2102, NSLocalizedDescription=请求超时。} 2016-01-14 17:49:24.550 ReleaseLife[1813:776149] upload 文件 0 success!
    踩0 评论0
  • 提交了问题 2015-10-05

    STSFederationToken过期时间不起作用

  • 回答了问题 2015-10-05

    STSFederationToken过期时间不起作用

    ReSTSFederationToken过期时间不起作用 /以下是业务服务器返回的token内容,'expiration':'1444035134' 是1970年以来的秒数。 生成的 java 方法是: long expirationtime=0; expirationstr=response.getCredentials().getExpiration(); java.util.Date date = new DateTime( expirationstr ).toDate(); expirationtime = date.getTime()/1000; //以下是业务服务器返回的token json内容{'FederationToken':{'expiration':'1444035134','accesskeyid':'STS.z1Toj0uqcEXsTYwboWyS','accesssecret':'Hhs4yDhjMoLaNuL3jAQ4GMJkJgqsZbHS2jfd1Mf4','securitytoken':'CAESrQMIARKAAYGoz50R7amNnrZZAjrB/AaceP8Lpp6jQjZEFCIPmTvG8PlLdUVJlhndBMnBndxUA8QjwZEg4Oo89ZcDnE01ID3VouOON4zKN1gbvgWB5WmNVsu1D1KAsUwNh+RqgV5TxTNavC4+P9yCoGfiiAU1/rZdE7aUBWUoPKIQ804NvXV7GhhTVFMuejFUb2owdXFjRVhzVFl3Ym9XeVMiEjM1MjA5MzU0Mjk5NTExNzEzOSoFuZ3NoZW5nMNWFzrmDKjoGUnNhTUQ1QpcBCgExGpEBCgVBbGxvdxI2CgxBY3Rpb25FcXVhbHMSBkFjdGlvbhoeCg1vc3M6R2V0QnVja2V0Cg1vc3M6R2V0T2JqZWN0ElAKDlJlc291cmNlRXF1YWxzEghSZXNvdXJjZRo0ChdhY3M6b3NzOio6KjpyZWxlYXNlbGlmZQoZYWNzOm9zczoqOio6cmVsZWFzZWxpZmUvKkoQMTg4ODkwNzIyNzEzNTk2MVIFMjY4NDJaD0Fzc3VtZWRSb2xlVXNlcmAAahIzNTIwOTM1NDI5OTUxMTcxMzlyBGZhbmc='}}
    踩0 评论0
正在加载, 请稍后...
滑动查看更多
正在加载, 请稍后...
暂无更多信息