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

I want to integrate image upload API in react native using react-native-image-crop-picker and in the image response I get only path not uri

$
0
0
const uploadFile = async () => {  ImagePicker.openPicker({    width: 300,    height: 300,    cropping: true,    mediaType: "photo",    forceJpg: true,  }).then((option) => {    console.log(option);    setImage(option.path);    const data = new FormData();    data.append("file", {      name: option?.filename,      type: option?.mime,      uri: option?.path,    });    axios.post("Api_URL /provider/UploadFile",      { file: data },      {        headers: {          Authorization: authToken,"Content-Type": "multipart/form-data",          Accept: "application/json",        },      }    );  });};

I'm new in this field so I don't have too much knowledge about it hope for the best Thank you


Viewing all articles
Browse latest Browse all 6290

Trending Articles



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