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

James Williams commented on CB-11199:
-------------------------------------

Upgraded from Android 3.7.1 to 5.1.1 and encountered this issue with FileReader 
readAsDataURL.  

FileReader readAsDataURL is broken when it comes to base 64 encoding of large 
files.  It is base64 encoding each 256K chunk and appending them together 
before returning them in FileReader.js.  That results in a base64 string that 
will not decode.

Our workaround was to override FileReader.READ_CHUNK_SIZE in the "deviceready" 
event and set it to a value > 256K. 

Example:

 FileReader.READ_CHUNK_SIZE = 104857600;

I hope this helps you.









> Plugin File: FileReader readAsDataURL does not work with JPG on Android 4.4.2
> -----------------------------------------------------------------------------
>
>                 Key: CB-11199
>                 URL: https://issues.apache.org/jira/browse/CB-11199
>             Project: Apache Cordova
>          Issue Type: Bug
>          Components: Plugin File
>    Affects Versions: 4.2.0
>         Environment: Android 4.4.2
>            Reporter: Caner Patır
>              Labels: Android, triaged, wfc
>
> FileReader readAsDataURL method encodes invalid base64 data for a jpeg image. 
> I could not decode the generate base64 data. But iI tried the same situation 
> on version 4.1.1 it works successfully. 



--
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