cordova-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jason Ginchereau (JIRA)" <>
Subject [jira] [Commented] (CB-7862) crash when copying big file from html file input with
Date Tue, 01 Mar 2016 19:15:18 GMT


Jason Ginchereau commented on CB-7862:

I reproduced this problem and looked into the cause. The problem is that the Cordova file
plugin's implementation of FileReader.readAsArrayBuffer() and other FileReader.readAs* methods
will always try to read the whole file in a single chunk. So if the file is large then the
app is likely to crash with an out-of-memory exception when it fails to allocate many megabytes
of contiguous memory.

It should be straightforward to fix the FileReader implementation to read large files in smaller
chunks. The FileReader API is already designed for that anyway, with its onprogress callback.

I've raised the priority to Critical because I think it's a pretty important thing to fix
(and surprising that it has been broken so long).

> crash when copying big file from html file input with 
> ------------------------------------------------------
>                 Key: CB-7862
>                 URL:
>             Project: Apache Cordova
>          Issue Type: Bug
>          Components: Plugin File
>    Affects Versions: 4.0.0
>         Environment: Android
>            Reporter: shenzhuxi
>            Priority: Critical
>              Labels: Android
> In Android, I tried to copy a 14MB file from html file input with org.apache.cordova.file
1.3.1. The App crashed and a 0 byte file was copied. 
> I use and here is my code

This message was sent by Atlassian JIRA

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message