Skip to content
This repository has been archived by the owner on Mar 16, 2019. It is now read-only.

Could not open downloaded image #495

Closed
korgara opened this issue Aug 18, 2017 · 2 comments
Closed

Could not open downloaded image #495

korgara opened this issue Aug 18, 2017 · 2 comments

Comments

@korgara
Copy link

korgara commented Aug 18, 2017

Hi. I tried to download some image from API using Android Download Manager and got it, when the image had been downloaded i can open it by tap on Download Manager notification, but when i opening the data path I see only the file Download-1 without any extension and which I can not open. How can I fix this to get just an image?

Here is my code:

savePhoto = () => {
    let path = RNFetchBlob.fs.dirs.DownloadDir;
    // console.log(path)
    RNFetchBlob.config({
        appendExt : 'jpg',
        addAndroidDownloads : {
            useDownloadManager : true,
            // title : new Date().toLocaleString() + '.jpg',
            notification : true,
            path: path,
            mime : 'image/jpg',
            mediaScannable: true,
        }
    })
    .fetch('GET','https://path_toimage.jpg')
    .then(r => {
        console.log(r, 'then')
    })
    .catch(err => console.log(err, 'error'))
}

quickmemo _2017-08-18-17-07-42

@wkh237
Copy link
Owner

wkh237 commented Aug 24, 2017

@korgara , I think the path should also containing the filename, and you can place extension there as well.

@korgara
Copy link
Author

korgara commented Aug 24, 2017

@wkh237 Yeah, it works! Thank you so much

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.