Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var fileInput = document.getElementById('image-file');
- document.getElementById('image-file').onchange = () => {
- var formData = new FormData();
- formData.append('pictureFile', fileInput.files[0]);
- formData.append('lastId', lastId);
- $.ajax({
- url: './tagimg',
- type: 'POST',
- processData: false, // important
- contentType: false, // important
- dataType : 'json',
- data: formData
- }).done((_user) => {
- window.location = '/tags';
- });
- };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement