Skip to content

Instantly share code, notes, and snippets.

@azizimusa
Created February 1, 2019 19:25
Show Gist options
  • Save azizimusa/0e7cffd015849cc9141cc82845aa2f21 to your computer and use it in GitHub Desktop.
Save azizimusa/0e7cffd015849cc9141cc82845aa2f21 to your computer and use it in GitHub Desktop.
You must save the image to device's picture directory.
import RNFS from "react-native-fs";
var destPath = RNFS.PicturesDirectoryPath + '/yourpicture.jpg';
RNFS.moveFile(data.uri, destPath)
.then((success) => {
console.log('file moved!');
})
.catch((err) => {
console.log("Error: " + err.message);
});
//then in your Mailer.mail attachment
//the correct path should be /storage/emulated/0/Pictures/yourpicture.jpg
path: destPath
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment