0

Is there any way to get sharedLink parameter, immediately after uploading a new file on box in BoxFile block.

I've tried following code, but it's returning sharedlink parameter as nil.

        BoxFilesRequestBuilder *builder = [[BoxFilesRequestBuilder alloc] init];
        builder.name = imageName;
        builder.parentID = folderID;

        //--- shared link object ---//
        BoxSharedObjectBuilder *sharedBuilder = [[BoxSharedObjectBuilder alloc] init];
        sharedBuilder.access = BoxAPISharedObjectAccessOpen;
        builder.sharedLink = sharedBuilder;

        NSInputStream *inputStream = [NSInputStream inputStreamWithFileAtPath:imagePath];
        NSDictionary *fileAttributes = [[NSFileManager defaultManager] attributesOfItemAtPath:imagePath 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];
niks
  • 544
  • 11
  • 28

1 Answers1

0

You have to make a second call after the file is uploaded.

Peter
  • 2,551
  • 1
  • 14
  • 20