[
https://issues.apache.org/jira/browse/CB-6050?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13904343#comment-13904343
]
Ian Clelland commented on CB-6050:
----------------------------------
I think, though, that the root problem is that what used to be an absolute file
path on the device ({{/sdcard/testCordova/file/file.pdf}}) is now treated as a
URL, which doesn't resolve.
One solution is to change the download location to
"file:///sdcard/testCordova/file/file.pdf" -- that should work with the current
versions of File and FileTransfer.
Another solution, which has been discussed before, is to treat any url
beginning with a "/" as an absolute file path, for backwards compatibility.
That makes it difficult to upload a file using a relative URL, but there should
be a way around that.
> FileTransfer.download always return error 3
> -------------------------------------------
>
> Key: CB-6050
> URL: https://issues.apache.org/jira/browse/CB-6050
> Project: Apache Cordova
> Issue Type: Bug
> Components: Android
> Affects Versions: 3.3.0
> Reporter: François
> Assignee: Ian Clelland
> Priority: Critical
>
> When I try to download a file, it returns error 3. I've try the doc example
> and it's not working. it give me this in logcat:
> 02-17 12:09:42.225: E/FileTransfer(907):
> {"target":"\/sdcard\/testCordova\/file\/file.pdf","source":"http:\/\/www.w3.org\/2011\/web-apps-ws\/papers\/Nitobi.pdf","http_status":200,"code":3}
> 02-17 12:09:42.225: E/FileTransfer(907): java.lang.NullPointerException
> 02-17 12:09:42.225: E/FileTransfer(907): at
> org.apache.cordova.PluginResult.<init>(PluginResult.java:52)
> 02-17 12:09:42.225: E/FileTransfer(907): at
> org.apache.cordova.filetransfer.FileTransfer$4.run(FileTransfer.java:798)
> 02-17 12:09:42.225: E/FileTransfer(907): at
> java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1076)
> 02-17 12:09:42.225: E/FileTransfer(907): at
> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:569)
> 02-17 12:09:42.225: E/FileTransfer(907): at
> java.lang.Thread.run(Thread.java:856)
--
This message was sent by Atlassian JIRA
(v6.1.5#6160)