wkh237 / react-native-fetch-blob

A project committed to making file access and data transfer easier, efficient for React Native developers.
MIT License
2.61k stars 1.59k forks source link

Renaming saved local files #545

Open asleepace opened 7 years ago

asleepace commented 7 years ago

Hi very simple request here, I would like to rename a file saved to the local device from RNFetchBlobTmpWhatever to something more friendly, how can I go about this?

react-native: 0.45.1

Here is my code:

    RNFetchBlob.config({fileCache:true, appendExt:this.props.ext})
    .fetch('GET', url, Request.headers())
    .then((res) => {
      this.setState({ loading: false });
      this.share(res.path());
      this.print(res.path());
    })
    .catch(error => console.log("ERROR DOWNLOADING:",error));
yingdongzhang commented 6 years ago

@Asleepace I guess you can use the mv method.