cordova-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Ian Clelland (JIRA)" <>
Subject [jira] [Commented] (CB-6015) FileTransfer error: Read-Only filesystem
Date Wed, 12 Feb 2014 03:17:19 GMT


Ian Clelland commented on CB-6015:

What version of file-transfer are you using with this? I think you may need to upgrade to
the latest file-transfer, if this isn't working for you.

>From the stacktrace, it appears that you are trying to use the {{fullPath}} property of
the FileEntry object as the location to save to.

{{FileEntry.fullPath}} _used_ to be a device-filesystem path from the root of your Android
filesystem to the actual file location (something like {{/data/data/app-name/avatar.jpeg}}
or {{/storage/emulated/0/sdcard/avatar.jpeg}},) but now, conforming to the actual spec, is
the path _relative to the root of the filesystem_, so just {{/avatar.jpeg}}.

What would happen now in that case is that "{{/avatar.jpeg}}" looks like a path to a file
in the root directory, which definitely is read-only. File-transfer complains because it can't
write to the root.

What you can do in that case is use the FileEntry's {{toURL()}} method to get an actual url
like {{cdvfile://localhost/persistent/avatar.jpeg}} that you can pass to the new version of (It should even work with the old version of file, since {{toURL()}}
used to just return the fullPath property).

> FileTransfer error: Read-Only filesystem
> ----------------------------------------
>                 Key: CB-6015
>                 URL:
>             Project: Apache Cordova
>          Issue Type: Bug
>          Components: Android, Plugin File, Plugin File Transfer
>    Affects Versions: 3.3.0
>            Reporter: Darryl Pogue
> Using the FileTransfer plugin to write to a FileEntry returned from the File plugin results
in an error.
> {code}
> D/FileTransfer(12423): download to //avatar.jpeg
> E/FileTransfer(12423): {"target":"\/\/avatar.jpeg","source":"http:\/\/\/image.jpeg","http_status":0,"code":1}
> E/FileTransfer(12423): /avatar.jpeg: open failed: EROFS
(Read-only file system)
> E/FileTransfer(12423): 	at
> E/FileTransfer(12423): 	at<init>(
> E/FileTransfer(12423): 	at org.apache.cordova.CordovaResourceApi.openOutputStream(
> E/FileTransfer(12423): 	at org.apache.cordova.CordovaResourceApi.openOutputStream(
> E/FileTransfer(12423): 	at org.apache.cordova.filetransfer.FileTransfer$
> E/FileTransfer(12423): 	at java.util.concurrent.ThreadPoolExecutor.runWorker(
> E/FileTransfer(12423): 	at java.util.concurrent.ThreadPoolExecutor$
> E/FileTransfer(12423): 	at
> E/FileTransfer(12423): Caused by: open failed: EROFS (Read-only
file system)
> E/FileTransfer(12423): 	at Method)
> E/FileTransfer(12423): 	at
> E/FileTransfer(12423): 	at
> E/FileTransfer(12423): 	... 7 more
> {code}
> This worked correctly before upgrading the file plugin.

This message was sent by Atlassian JIRA

View raw message