How to upload an audio clip from react-native to php backend?
FIX
used lib - react-native-fetch-blob
code
import RNFetchBlob from 'react-native-fetch-blob'; let dirs = RNFetchBlob.fs.dirs; let path_to_a_file = dirs.DownloadDir + '/header_logo.png'; RNFetchBlob.fetch('POST', 'http://192.168.43.236/upload.php', { Authorization : "Bearer access-token", otherHeader : "foo", 'Content-Type' : 'multipart/form-data', }, [ { name : 'header_logo', filename : 'header_logo.png', type:'image/foo', data:RNFetchBlob.wrap(path_to_a_file)}, ]).then((resp) => { console.log(resp.text()) }).catch((err) => { console.log(err) })