Fix uploading files through AJAX