forked from itinance/react-native-fs
-
Notifications
You must be signed in to change notification settings - Fork 9
/
Uploader.h
29 lines (22 loc) · 1.04 KB
/
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
29
#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 (assign) BOOL binaryStreamOnly;
@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