400 bad request admin-ajax file upload

I’m having some trouble while I’m making an upload plugin. I’m using ajax to do the upload, but during the first test I get a 400 bad request error. Is there a fix for this? Here is the js code (function($){ $(document).ready(function(){ $(‘#process-upload’).on(‘click’, function(e){ e.preventDefault(); var data = new FormData(); data.append(‘file’, $(‘#imageFile’).prop(‘files’)[0] ); data.append(‘action’, ‘new_message’);…