Reputation: 1640
I'm using WAToolkit to add blob to container,but when upload big file it will generate the error:Error Domain=com.microsoft.WAToolkit Code=413 "The request body is too large and exceeds the maximum permissible limit.".The remarks section of the doc indicates the maximum upload size for a block blob is 64 MB. The app may also receive memory warning.
NSString *blobName = @"IMG_0242.MOV";
WABlob *blob = [[[WABlob alloc] initBlobWithName:blobName URL:nil containerName:self.selectedContainer.name] autorelease];
NSString *filePath = [[NSBundle mainBundle]pathForResource:blobName ofType:nil];
blob.contentData = [[NSData alloc]initWithContentsOfFile:filePath];
[[NSOperationQueue mainQueue]addOperationWithBlock:^{
[storageClient addBlob:blob
toContainer:self.selectedContainer
withCompletionHandler:^(NSError* error) {
if(error) {
NSLog(@"error:%@",error);
return;
}
}];
}];
How to change the code or use other method to solve the problem?
Upvotes: 0
Views: 1732
Reputation: 18387
You have to split your file. Here a few links that could help you:
Best way to upload a blob with a huge size in GBs to azure in the fastest time
http://justazure.com/azure-blob-storage-part-4-uploading-large-blobs/
Upvotes: 1