Last active
November 9, 2016 16:40
-
-
Save fel-cesar/7c8d393036eb142bac2afd05f54eb34d to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// self.service = [[CRMicrosoftAzure alloc] initWithAccountName:@"[account_name]" accessKey:@"[access_key]"]; | |
// self.service = [[CRAmazonS3 alloc] initWithAccessKeyId:@"[clientID]" secretAccessKey:@"[client_Secret]" region:@"[region]"]; | |
// self.service = [[CRRackspace alloc] initWithUsername:@"[username]" apiKey:@"[api_key]" region:@"[region]"]; | |
self.service = [[CRBackblaze alloc] initWithAccountID:@"[account_init]" appKey:@"[app_key]"]; | |
CRBucket * bucket = [[CRBucket alloc] init]; | |
bucket.name = @"[bucket_name]"; | |
bucket.identifier = @"[bucket_id]"; | |
NSData * data = //data source; | |
NSInputStream * inputStream = [NSInputStream inputStreamWithData:data]; | |
@try { | |
[self.currentService uploadFileToBucket:bucket name:@"[file_name]" withStream:inputStream size:data.length]; | |
} @catch (NSException *exception) { | |
//handle exception | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment