react-native-background-upload
react-native-background-upload copied to clipboard
How can I specify filename?
Using fetch()
I could upload a file like this:
const file = {uri: 'file://my/file/path', name: 'custom_name.aac', type: 'audio/aac'}
const body = new FormData()
body.append('session', this.state.session)
body.append('id', this.state.id)
body.append('file', file)
fetch(global.BACKEND_URL+'media/upload.php', {
method: 'POST',
body
})
and whatever the actual filename was, in the webservice I received in $_FILES['file']['name']
my custom name.
Is that possible?
Thank you so much, amazing component anyway
same question