有没有办法在BoxFile块上的框上传新文件后立即获取sharedLink参数。
我已尝试使用代码,但它将sharedlink参数作为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];
答案 0 :(得分:0)
上传文件后,您必须再拨一次电话。