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

Download manager could not resolve downloaded file path. #474

Open
@kholiavko-roman

Description

@kholiavko-roman

Hi! Thanks for you module!
While development I have one issue, when I try to download file using addAndroidDownloads

Error: Error: Download manager could not resolve downloaded file path.
Status code: undefined

Here is my code:

RNFetchBlob
    .config({
        addAndroidDownloads : {
            useDownloadManager : true,
            notification : false,
            title: 'pdfurl-guide.pdf',
            mime : 'application/pdf',
            description : 'File downloaded by download manager.'
        },
    })
    .fetch('GET', 'http://www.axmag.com/download/pdfurl-guide.pdf')
    .then((resp) => {
        console.log('DOWNLOAD complete');

        RNFetchBlob.fs.exists(resp.path())
        .then((exist) => {
            console.log(`file ${exist ? '' : 'not'} exists`)
        })
        .catch(() => {
            console.log('error while checking file for exists');
        });

        console.log(resp.path());      
    })
    .catch((errorMessage, statusCode) => {
        console.log('Error: ' + errorMessage);
        console.log('Status code: ' + statusCode);
    });

I check my path, and it return FOLDER exists

let path = RNFetchBlob.fs.dirs.DocumentDir;

RNFetchBlob.fs.exists(path)
        .then((exist) => {
            console.log(`FOLDER ${exist ? '' : 'not'} exists`)
        })
        .catch(() => {
            console.log('error while checking FOLDER for exists');
        });

Can you help me please ? Maybe I make mistake somewhere ?

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions