Fixed ios file path encoding

This commit is contained in:
Rubén Panadero 2019-05-24 14:15:52 +02:00
parent f7e1da9f14
commit b08fb4050e

View File

@ -31,7 +31,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- (void) open: (CDVInvokedUrlCommand*)command { - (void) open: (CDVInvokedUrlCommand*)command {
NSString *path = [[command.arguments objectAtIndex:0] stringByAddingPercentEncodingWithAllowedCharacters:[NSCharacterSet URLPathAllowedCharacterSet]]; NSString *path = [[command.arguments objectAtIndex:0] stringByAddingPercentEncodingWithAllowedCharacters:[NSCharacterSet URLQueryAllowedCharacterSet]];
NSString *contentType = [command.arguments objectAtIndex:1]; NSString *contentType = [command.arguments objectAtIndex:1];
BOOL showPreview = YES; BOOL showPreview = YES;
@ -53,7 +53,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
} }
dispatch_async(dispatch_get_main_queue(), ^{ dispatch_async(dispatch_get_main_queue(), ^{
NSURL *fileURL = [NSURL URLWithString:[path stringByRemovingPercentEncoding]]; NSURL *fileURL = [NSURL URLWithString:path];
localFile = fileURL.path; localFile = fileURL.path;