question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

RNFetchBlob.fs.mv error: source file at path {PATH} does not exists

See original GitHub issue

MAY BE A BUG

When I am trying to move file from one directory to another this error is shown in console:

await RNFetchBlob.fs.mv(this.state.sourcePath, FilePicturePath() + this.state.filename);
item.js:136 Error: mv error: source file at path `file:///storage/emulated/0/Pictures/TEMP/1533659324.png` does not exists
    at fs.js:256
    at MessageQueue.__invokeCallback (MessageQueue.js:398)
    at MessageQueue.js:137
    at MessageQueue.__guardSafe (MessageQueue.js:314)
    at MessageQueue.invokeCallbackAndReturnFlushedQueue (MessageQueue.js:136)
    at debuggerWorker.js:70

but I am pretty shure file is exist, because when I run following code it prints true

let exists = await RNFetchBlob.fs.exists(this.state.sourcePath);
console.log(exists);

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:5

github_iconTop GitHub Comments

3reactions
baxricommented, Aug 10, 2018

You are right @ihavenoface5, it was an issue of the file:// prefix.

Incorrect:

file:///storage/emulated/0/Pictures/TEMP/1533659324.png

Correct:

/storage/emulated/0/Pictures/TEMP/1533659324.png
3reactions
ihavenoface5commented, Aug 10, 2018

It looks like the mv function doesn’t expect a file URI (i.e. file:///storage/emulated/0/Pictures/TEMP/1533659324.png), but instead expects a path (/storage/emulated/0/Pictures/TEMP/1533659324.png). Can you try doing the move without the file:// appended to the beginning?

Read more comments on GitHub >

github_iconTop Results From Across the Web

File not exists · Issue #116 · joltup/rn-fetch-blob - GitHub
Following this, i'm trying to get the content file; Using react-native-document-picker, after select the file I do this: if (Platform.
Read more >
React native and rn-fetch-blob move captured image from ...
I am creating an app where the user will take a photo of the documents and save to the server. Source File at...
Read more >
react-native-fetch-blob - npm
A module provides upload, download, and files access API. Supports file stream read/write for process large files.. Latest version: 0.10.8, ...
Read more >
Top 5 rn-fetch-blob Code Examples - Snyk
Learn more about how to use rn-fetch-blob, based on rn-fetch-blob code examples created from the most popular ways it is used in public...
Read more >
rn-fetch-blob.FS.exists JavaScript and Node.js code examples
Check if file exists and if it is a folder. FS.mkdir,; FS.readFile,; FetchBlobResponse.path,; RNFetchBlobStatic.config,; config ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found