search

Home  >  Q&A  >  body text

七牛云存储 - iOS的七牛SDK如何支持后台上传文件

PHP中文网PHP中文网2823 days ago672

reply all(1)I'll reply

  • 巴扎黑

    巴扎黑2017-04-17 16:16:34

    The iOS SDK has an upload function that can be called directly,

        NSString token = @"从服务端SDK获取";
        QNUploadManager *upManager = [[QNUploadManager alloc] init];
        NSData *data = [@"Hello, World!" dataUsingEncoding : NSUTF8StringEncoding];
        [upManager putData:data key:@"hello" token:token
            complete: ^(QNResponseInfo *info, NSString *key, NSDictionary *resp) {
            NSLog(@"%@", info);
            NSLog(@"%@", resp);
        } option:nil];

    If you are talking about letting your backend upload to your server, then you can also let your backend server access the server's SDK:

    http://developer.qiniu.com/docs/v6/index.html

    reply
    0
  • Cancelreply