forked from itinance/react-native-fs
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Uploader.h
32 lines (24 loc) · 1.06 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
30
31
32
#import <Foundation/Foundation.h>
#if !TARGET_OS_OSX
#import <MobileCoreServices/MobileCoreServices.h>
#endif
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