[Answered ]-CSRF protection always failing when trying to upload file with ajax

2👍

You should use

form.append("csrfmiddlewaretoken", csrftoken)

While you were trying to do form.append("csrftoken", csrftoken)

Leave a comment