0

Why i use the cordova-plugin-file-transfer to download a image, i could use the entry.toURL in the image src, the image could display, but i can't find the image in my android devices: the path 'file:///data/data/com.example.hello/cache/123.png' not found

4
  • tried out something like this in the past and faced the same issue. Looks like the phone needs to be rooted to make it work. Checkout this github link for working sample on this - github.com/gandhirajan/Cordova_File_Operations
    – Gandhi
    Aug 15, 2016 at 5:27
  • Thanks you very much, it works, i totally waste some days to figure out what's the problem, but you save my life:) Aug 15, 2016 at 7:10
  • have updated the answer. Please accept so that it helps others too. Glad u made it work. Cheers
    – Gandhi
    Aug 15, 2016 at 7:16
  • If download success, you should re-scan your device storage, because Cordova does not know if the file is downloaded. so i made a plugin , It is a plugin that updates the gallery after downloading. github.com/pouu69/cordova-plugin-gallery-refresh Jul 5, 2017 at 4:18

1 Answer 1

0

Tried out something like this in the past and faced the same issue. Looks like the phone needs to be rooted to make it work. Checkout this github link for working sample on this. It downloads file from server using file transfer plugin and saves it in device using file plugin.

1
  • thanks for that sample.Does this sample only provide pdf file?Can I use this for download videos and images and when offline list that videos and images from device Dec 24, 2019 at 10:33

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.