[ 
https://issues.apache.org/jira/browse/CB-9837?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15053685#comment-15053685
 ] 

ASF GitHub Bot commented on CB-9837:
------------------------------------

Github user dblotsky commented on the pull request:

    
https://github.com/apache/cordova-plugin-file-transfer/pull/122#issuecomment-164065701
  
    Ah, gotcha. Thanks for the explanation. If the tests pass, then it LGTM!


> Add data URI support to file-transfer upload on iOS
> ---------------------------------------------------
>
>                 Key: CB-9837
>                 URL: https://issues.apache.org/jira/browse/CB-9837
>             Project: Apache Cordova
>          Issue Type: New Feature
>          Components: Plugin File Transfer
>            Reporter: Juan Antonio
>              Labels: ios, reproduced, triaged
>
> When I send an encoded base64 string image from iOS device with 
> 'data:image/jpeg;base64,' at the beginning of data image on 
> ft.upload(fileURL...) , plugin file transfer crash. However, on android works 
> perfectly ONLY if line 'data:image/jpeg;base64,' is present.
> Possible solution:
> If I delete string data 'data:image/jpeg;base64,' for iOS devices and modify 
> plugin file iOS 'CDVFileTransfer.m' like this:
> - (void)fileDataForUploadCommand:(CDVInvokedUrlCommand*)command
> {
>     NSString* source = (NSString*)[command argumentAtIndex:0];
>     NSData *fileData = [[NSData alloc] initWithBase64EncodedString:source 
> options:NSDataBase64DecodingIgnoreUnknownCharacters];
>     [self uploadData:fileData command:command];
> }
> works perfectly, but it wouldn't accept image path, only base64 string 
> encoded images.
> Thanks.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscr...@cordova.apache.org
For additional commands, e-mail: issues-h...@cordova.apache.org

Reply via email to