Skip to content
This repository was archived by the owner on Apr 25, 2023. It is now read-only.
This repository was archived by the owner on Apr 25, 2023. It is now read-only.

err Error: ENOENT: no such file or directory #2

@shimangdian

Description

@shimangdian

hello ,when i use this lib chose a folder and react-native-fs to downloadFile, i get this error:

err Error: ENOENT: no such file or directory, open 'content://com.android.externalstorage.documents/tree/15F4-2D1A%3ADownload/document/15F4-2D1A%3ADownload/'

there is my code:

selectDirectory().then((path) => {
                console.log(path);
                //
                const downloadDest = `${path}/`;
                //
                const options = {
                    fromUrl: url,
                    toFile: downloadDest,
                    background: true,
                    begin: (res) => {
                        console.log('begin', res);
                        console.log('contentLength:', res.contentLength / 1024 / 1024, 'M');
                    },
                    progress: (res) => {
      
                        let pro = res.bytesWritten / res.contentLength;
                        console.log('pro==', pro);
                    },
                };
                try {
                    const ret = RNFS.downloadFile(options);
                    ret.promise
                        .then((res) => {
                            console.log('success', res);
                            console.log('file://' + downloadDest);
                        })
                        .catch((err) => {
                            console.log('err', err);
                        });
                } catch (e) {
                    console.log(e);
                }
            });

can i get any help?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions