Quantcast
Channel: Active questions tagged react-native+typescript - Stack Overflow
Viewing all articles
Browse latest Browse all 6287

How to upload an image from React Native into MySQL using Adonis Js (node js framework)?

$
0
0

I have used the React Native Document picker to choose the image/file but how can I upload all of the assets data (image/pdf) to cloud and get URL back to my database (mySQL). I'm using adonis Js in backend?

const form: FC = () => {  const [selfie, setSelfie] = useState();  const selectSelfie = async () => {    //Opening Document Picker for selection of one file    try {      const res = await DocumentPicker.pick({         type: ['image/*','application/pdf']      });      setSelfie(res[0]);} catch (err) {      if (DocumentPicker.isCancel(err)) {        alert('Canceled from your side, please try again');      } else {        alert('Unknown Error: '+ JSON.stringify(err));        throw err;      }    }  };

Viewing all articles
Browse latest Browse all 6287

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>