function upload_cover(){ var cover = new FormData(); var fileObj = document.getElementById('cover').files[0]; cover.append('cover', fileObj) $.ajax({ type: 'post', url: '/upload_cover', data: cover, async: false, processData: false, contentType: fals…