forked from status-im/react-native-fs
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Uploader.h
28 lines (21 loc) · 1018 Bytes
/
Uploader.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
#import <Foundation/Foundation.h>
#import <MobileCoreServices/MobileCoreServices.h>
typedef void (^UploadCompleteCallback)(NSString*, NSURLResponse *);
typedef void (^UploadErrorCallback)(NSError*);
typedef void (^UploadBeginCallback)(void);
typedef void (^UploadProgressCallback)(NSNumber*, NSNumber*);
@interface RNFSUploadParams : NSObject
@property (copy) NSString* toUrl;
@property (copy) NSArray* files;
@property (copy) NSDictionary* headers;
@property (copy) NSDictionary* fields;
@property (copy) NSString* method;
@property (copy) UploadCompleteCallback completeCallback; // Upload has finished (data written)
@property (copy) UploadErrorCallback errorCallback; // Something gone wrong
@property (copy) UploadBeginCallback beginCallback; // Upload has started
@property (copy) UploadProgressCallback progressCallback; // Upload is progressing
@end
@interface RNFSUploader : NSObject <NSURLConnectionDelegate>
- (void)uploadFiles:(RNFSUploadParams*)params;
- (void)stopUpload;
@end