Skip to content

request.file: Unable to pull in a file submitted through axios #3234

Discussion options

You must be logged in to vote

I wasn't aware that <input type="file"> "lets you access the list of files selected ... dropped into web content when using the drag and drop API" https://developer.mozilla.org/en-US/docs/Web/API/FileList

All I had to do was destructure the incoming form data as per the following

...async ({ commit }, form) => {
    const { files: [image,], ...rest } = form
    const meme = { image, ...rest }
    ...
    const formData = new FormData()
}

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by tafadzwagonera
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Help
Labels
None yet
1 participant