Created
September 14, 2018 23:06
-
-
Save codepainkiller/2a8f2b9192256679fe5b6aab0a74aadf to your computer and use it in GitHub Desktop.
Ajax Upload file
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
$('#form').on('submit', function (e) { | |
e.preventDefault(); | |
const formData = new FormData(this); | |
$.ajax({ | |
method: 'post', | |
url: '/ajax/path', | |
data: formData, | |
cache: false, | |
contentType: false, | |
processData: false, | |
}).done(function (response) { | |
console.log(response); | |
}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment