Note that there are some explanatory texts on larger screens.

plurals
  1. POBOX SDK Error while uploading file
    primarykey
    data
    text
    <p>This is the method I used to authenticate my box and it opens a web view and I successfully got authenticated:</p> <pre><code>- (IBAction)box:(id)sender { NSURL *authorizationURL = [BoxSDK sharedSDK].OAuth2Session.authorizeURL; NSString *redirectURI = [BoxSDK sharedSDK].OAuth2Session.redirectURIString; BoxAuthorizationViewController *authorizationViewController = [[BoxAuthorizationViewController alloc] initWithAuthorizationURL:authorizationURL redirectURI:redirectURI]; BoxAuthorizationNavigationController *loginNavigation = [[BoxAuthorizationNavigationController alloc] initWithRootViewController:authorizationViewController]; authorizationViewController.delegate = loginNavigation; loginNavigation.modalPresentationStyle = UIModalPresentationFormSheet; [self presentViewController:loginNavigation animated:YES completion:nil]; } </code></pre> <p>After this process it returns to same view controller where I have a another action for upload (<a href="https://github.com/box/box-ios-sdk-sample-app" rel="nofollow noreferrer">https://github.com/box/box-ios-sdk-sample-app</a>):</p> <pre><code>- (IBAction)upload:(id)sender { BoxFileBlock fileBlock = ^(BoxFile *file) { [self fetchFolderItemsWithFolderID:self.folderID name:self.navigationController.title]; dispatch_sync(dispatch_get_main_queue(), ^{ UIAlertView *alertView = [[UIAlertView alloc] initWithTitle:@"File Upload Successful" message:[NSString stringWithFormat:@"File has id: %@", file.modelID] delegate:self cancelButtonTitle:@"OK" otherButtonTitles:nil]; [alertView show]; }); }; BoxAPIJSONFailureBlock failureBlock = ^(NSURLRequest *request, NSHTTPURLResponse *response, NSError *error, NSDictionary *JSONDictionary) { BOXLog(@"status code: %i", response.statusCode); BOXLog(@"upload response JSON: %@", JSONDictionary); }; BoxFilesRequestBuilder *builder = [[BoxFilesRequestBuilder alloc] init]; builder.name = @"image1.jpg"; builder.parentID = self.folderID; NSString *path = [[NSBundle mainBundle] pathForResource:@"image1.jpg" ofType:nil]; NSInputStream *inputStream = [NSInputStream inputStreamWithFileAtPath:path]; NSDictionary *fileAttributes = [[NSFileManager defaultManager] attributesOfItemAtPath:path error:nil]; long long contentLength = [[fileAttributes objectForKey:NSFileSize] longLongValue]; [[BoxSDK sharedSDK].filesManager uploadFileWithInputStream:inputStream contentLength:contentLength MIMEType:nil requestBuilder:builder success:fileBlock failure:failureBlock progress:nil]; } </code></pre> <p>After clicking upload button I receive this following message in console </p> <p><img src="https://i.stack.imgur.com/cj1w4.png" alt="Console error"></p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload