cordova-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Ian Clelland (JIRA)" <>
Subject [jira] [Commented] (CB-6117) cdvfile file url is not working with html5 image src
Date Fri, 28 Feb 2014 15:50:19 GMT


Ian Clelland commented on CB-6117:

Hi [~ritasakhuja],

The only difference for Android < 4.0 is that I use {{.toNativeURL()}} in place of {{.toURL()}}
right now.

The code would look like this:

var filename = "feather.gif";
var imageURL = "";

requestFileSystem(TEMPORARY, 0, function(fileSystem) {
    var ft = new FileTransfer();, fileSystem.root.toURL() + "/" + filename, function(entry) {
        var imgElement = new Image();
        imgElement.src = entry.toNativeURL();

For your last issue, I believe that the problem is that the File plugin is not configure to
initialize itself when your application starts. This is an issue with the current version
of the plugin, but is fixed in the development version. (The JIRA issue is CB-6087). That
version should be released as v1.0.1 very soon, and will also include the {{.toNativeURL}}

> cdvfile file url is not working with html5 image src
> ----------------------------------------------------
>                 Key: CB-6117
>                 URL:
>             Project: Apache Cordova
>          Issue Type: Bug
>          Components: Plugin File, Plugin File Transfer
>    Affects Versions: 3.4.0
>            Reporter: rita
>            Priority: Critical
> Hi 
> I had used the fileTranser APi to download the image from a given path.
> The image was downloaded at the path cdvfile://localhost/persistent/SPB/ics-android.png.
> But I am unable to access this image as url for <img> tag in html.Same code was
working till 2.9.0

This message was sent by Atlassian JIRA

View raw message