Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Web and WebWorks Development

Posts: 36
Registered: ‎06-28-2012
My Device: BB10
My Carrier: RIM

FileReader.onLoad() is not called in blackberry device


I have made an application in which user selects image file and shows that image in page.But here reader.onload() event is not called.

Below is my code.


<!DOCTYPE html>
.thumb {
height: 75px;
border: 1px solid #000;
margin: 10px 5px 0 0;

<input type="file" id="files" name="files[]" multiple />
<output id="list"></output>

function handleFileSelect(evt) {
var files = evt.target.files; // FileList object

// Loop through the FileList and render image files as thumbnails.
for (var i = 0, f; f = files[i]; i++) {

// Only process image files.
if (!f.type.match('image.*')) {

var reader = new FileReader();


// Closure to capture the file information.
reader.onload = (function(theFile) {
return function(e) {
// Render thumbnail.
var span = document.createElement('span');
span.innerHTML = ['<img class="thumb" src="', e.target.result,
'" title="', escape(theFile.name), '"/>'].join('');
document.getElementById('list').insertBefore(span, null);

// Read in the image file as a data URL.

document.getElementById('files').addEventListener('change', handleFileSelect, false);


It is not throwing any error.But still it is not working.

Please replay fast becuse it is urgent.


Posts: 1,382
Registered: ‎07-02-2009
My Device: BlackBerry Bold 9900
My Carrier: Bell

Re: FileReader.onLoad() is not called in blackberry device

I just ran your code (on a PlayBook running 2.0) from jsfiddle and everything looks and works fine to me.




Did you make any progress on this yourself?

Follow me on Twitter: @n_adam_stanley
Your app doesn't work? Use BlackBerry remote web inspector to find out why.