Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How can I specify filename? #108

Open
pottercomuneo opened this issue Nov 16, 2018 · 1 comment
Open

How can I specify filename? #108

pottercomuneo opened this issue Nov 16, 2018 · 1 comment

Comments

@pottercomuneo
Copy link

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

@bayaroch
Copy link

same question

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants