Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 1 addition & 10 deletions ios/RNFSManager.m
Original file line number Diff line number Diff line change
Expand Up @@ -458,7 +458,7 @@ + (BOOL)requiresMainQueueSetup

- (NSArray<NSString *> *)supportedEvents
{
return @[@"UploadBegin",@"UploadProgress",@"DownloadBegin",@"DownloadProgress",@"DownloadResumable"];
return @[@"DownloadBegin",@"DownloadProgress",@"DownloadResumable"];
}

RCT_EXPORT_METHOD(downloadFile:(NSDictionary *)options
Expand Down Expand Up @@ -603,15 +603,6 @@ + (BOOL)requiresMainQueueSetup
resolve(nil);
}

RCT_EXPORT_METHOD(stopUpload:(nonnull NSNumber *)jobId)
{
RNFSUploader* uploader = [self.uploaders objectForKey:[jobId stringValue]];

if (uploader != nil) {
[uploader stopUpload];
}
}

RCT_EXPORT_METHOD(getFSInfo:(RCTPromiseResolveBlock)resolve rejecter:(RCTPromiseRejectBlock)reject)
{
unsigned long long totalSpace = 0;
Expand Down
30 changes: 0 additions & 30 deletions src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -69,36 +69,6 @@ export type DownloadResult = {
bytesWritten: number; // The number of bytes written to the file
};

export type UploadFileOptions = {
toUrl: string; // URL to upload file to
binaryStreamOnly?: boolean; // Allow for binary data stream for file to be uploaded without extra headers, Default is 'false'
files: UploadFileItem[]; // An array of objects with the file information to be uploaded.
headers?: Headers; // An object of headers to be passed to the server
fields?: Fields; // An object of fields to be passed to the server
method?: string; // Default is 'POST', supports 'POST' and 'PUT'
beginCallback?: (res: UploadBeginCallbackResult) => void; // deprecated
progressCallback?: (res: UploadProgressCallbackResult) => void; // deprecated
begin?: (res: UploadBeginCallbackResult) => void;
progress?: (res: UploadProgressCallbackResult) => void;
};

export type UploadFileItem = {
name: string; // Name of the file, if not defined then filename is used
filename: string; // Name of file
filepath: string; // Path to file
filetype: string; // The mimetype of the file to be uploaded, if not defined it will get mimetype from `filepath` extension
};

export type UploadBeginCallbackResult = {
jobId: number; // The upload job ID, required if one wishes to cancel the upload. See `stopUpload`.
};

export type UploadProgressCallbackResult = {
jobId: number; // The upload job ID, required if one wishes to cancel the upload. See `stopUpload`.
totalBytesExpectedToSend: number; // The total number of bytes that will be sent to the server
totalBytesSent: number; // The number of bytes sent to the server
};

export type FSInfoResult = {
totalSpace: number; // The total amount of storage space on the device (in bytes).
freeSpace: number; // The amount of available storage space on the device (in bytes).
Expand Down