08Thug commented on issue #346: File Path Issue in iOS 13.1
URL: 
https://github.com/apache/cordova-plugin-file/issues/346#issuecomment-579729876
 
 
   Well the problem is with the apache cordova camera plugin it provides the 
temporary path to the video file to come out from this error implement below 
changes in camera plugin.
   
   in CDVCamera.m change THIS:
   
   (CDVPluginResult*)resultForVideo:(NSDictionary*)info
   {
   NSString* moviePath = [[info objectForKey:UIImagePickerControllerMediaURL] 
absoluteString];
   return [CDVPluginResult resultWithStatus:CDVCommandStatus_OK 
messageAsString:filePath];
   }
   to THIS:
   
   (CDVPluginResult*)resultForVideo:(NSDictionary*)info
   {
   NSString* moviePath = [[info objectForKey:UIImagePickerControllerMediaURL] 
path];
   
   NSArray* spliteArray = [moviePath componentsSeparatedByString: @"/"];
   NSString* lastString = [spliteArray lastObject];
   NSError *error;
   NSFileManager *fileManager = [NSFileManager defaultManager];
   NSString *documentsDirectory = [NSHomeDirectory() 
stringByAppendingPathComponent:@"tmp"];
   NSString *filePath = [documentsDirectory 
stringByAppendingPathComponent:lastString];
   [fileManager copyItemAtPath:moviePath toPath:filePath error:&error];
   
   return [CDVPluginResult resultWithStatus:CDVCommandStatus_OK 
messageAsString:filePath];
   }
   Hope it will help you.
   
   And ofcourse you should perform this also
   
    if (this.platform.is('android')) {
       filePath = 'file:///' + this.uploadForm.controls['file'].value;
     } else {
       filePath = this.uploadForm.controls['file'].value;
     }

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to