在 BoxFile 块中的框中上传新文件后,有什么方法可以立即获取 sharedLink 参数。
我试过以下代码,但它返回的 sharedlink 参数为零。
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];