diff --git a/ios/RNFSManager.m b/ios/RNFSManager.m index 58579bcf..f38b08b7 100755 --- a/ios/RNFSManager.m +++ b/ios/RNFSManager.m @@ -458,7 +458,7 @@ + (BOOL)requiresMainQueueSetup - (NSArray *)supportedEvents { - return @[@"UploadBegin",@"UploadProgress",@"DownloadBegin",@"DownloadProgress",@"DownloadResumable"]; + return @[@"DownloadBegin",@"DownloadProgress",@"DownloadResumable"]; } RCT_EXPORT_METHOD(downloadFile:(NSDictionary *)options @@ -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; diff --git a/src/types.ts b/src/types.ts index 45ea45d4..fd5ffda8 100644 --- a/src/types.ts +++ b/src/types.ts @@ -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).