react-native-background-upload icon indicating copy to clipboard operation
react-native-background-upload copied to clipboard

How can I specify filename?

Open pottercomuneo opened this issue 6 years ago • 1 comments

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

pottercomuneo avatar Nov 16 '18 12:11 pottercomuneo

same question

bayaroch avatar Jun 15 '20 08:06 bayaroch