BmobFile Class Reference
Inherits from | NSObject |
---|---|
Declared in | BmobFile.h |
– initWithClassName:withFilePath:
DEPRECATED: 使用-(id)initWithFilePath:(NSString*)filePath;代替
- (id)initWithClassName:(NSString *)className withFilePath:(NSString *)filePath
Declared In
BmobFile.h
– initWithClassName:withFileName:withFileData:
DEPRECATED: 使用-(id)initWithFileName:(NSString)fileName withFileData:(NSData)data;代替
- (id)initWithClassName:(NSString *)className withFileName:(NSString *)fileName withFileData:(NSData *)data
Declared In
BmobFile.h
– initWithFilePath:
创建BmobFile对象 可代替-(id)initWithClassName:(NSString)className withFilePath:(NSString)filePath;
- (id)initWithFilePath:(NSString *)filePath
Parameters
filePath |
文件路径 |
---|
Return Value
BmobFile对象实例
Declared In
BmobFile.h
– initWithFileName:withFileData:
创建BmobFile对象 可代替-(id)initWithClassName:(NSString )className withFileName:(NSString)fileName withFileData:(NSData*)data;
- (id)initWithFileName:(NSString *)fileName withFileData:(NSData *)data
Parameters
fileName |
文件名称,请加上后缀 |
---|---|
data |
二进制数据 |
Return Value
BmobFile对象实例
Declared In
BmobFile.h
– saveInBackground:
异步上传文件并保存
- (void)saveInBackground:(BmobBooleanResultBlock)block
Parameters
block |
返回保存结果与信息,如果保存成功,则无返回信息 |
---|
Declared In
BmobFile.h
– saveInBackground:withProgressBlock:
异步上传文件并保存
- (void)saveInBackground:(BmobBooleanResultBlock)block withProgressBlock:(void ( ^ ) ( float progress ))progressBlock
Parameters
block |
返回保存结果与信息,如果保存成功,则无返回信息 |
---|---|
progressBlock |
上传进度 |
Declared In
BmobFile.h
– saveInBackgroundByDataSharding:
以分片的方式上传文件
- (void)saveInBackgroundByDataSharding:(BmobBooleanResultBlock)block
Parameters
block |
返回保存结果与信息,如果保存成功,则无返回信息 |
---|
Declared In
BmobFile.h
– saveInBackgroundByDataSharding:progressBlock:
以分片的方式上传文件
- (void)saveInBackgroundByDataSharding:(BmobBooleanResultBlock)block progressBlock:(void ( ^ ) ( float progress ))progressBlock
Parameters
block |
返回保存的结果与信息,如果保存成功则无返回信息 |
---|---|
progressBlock |
上传文件的进度 |
Declared In
BmobFile.h
– deleteInBackground:
异步请求删除文件
- (void)deleteInBackground:(BmobBooleanResultBlock)block
Parameters
block |
返回删除结果与信息,如果删除成功,则无返回信息 |
---|
Declared In
BmobFile.h
+ filesUploadBatchWithPaths:progressBlock:resultBlock:
批量上传文件
+ (void)filesUploadBatchWithPaths:(NSArray *)pathArray progressBlock:(BmobFileBatchProgressBlock)progress resultBlock:(BmobFileBatchResultBlock)block
Parameters
pathArray |
路径数组 |
---|---|
progress |
当前第几个,当前文件的进度 |
block |
BmobFile数组,上传结果和失败信息 |
Declared In
BmobFile.h
+ filesUploadBatchWithDataArray:progressBlock:resultBlock:
批量上传文件
+ (void)filesUploadBatchWithDataArray:(NSArray *)dataArray progressBlock:(BmobFileBatchProgressBlock)progress resultBlock:(BmobFileBatchResultBlock)block
Parameters
dataArray |
数组中存放的NSDictionary,NSDictionary里面的格式为@{@“filename”:@“你的文件名”,@“data”:图片的data} 文件名需要带后缀 |
---|---|
progress |
当前第几个,当前文件的进度 |
block |
BmobFile数组,上传结果和失败信息 |
Declared In
BmobFile.h