Last active
August 27, 2019 11:15
-
-
Save SanjayBoricha/1b06e164740ff85631369229e330d140 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export const uploadImage = file => dispatch => { | |
const data = new FormData(); | |
data.append('file', file, file.name); | |
axios({ | |
method: 'POST', | |
url: path, | |
data: data, | |
headers: { | |
'Content-Type': `multipart/form-data; boundary=${data._boundary}` | |
} | |
}) | |
.then(res => console.log(res)) | |
.catch(e => console.log(e)); | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment