[Django]-File not in request.FILES but in request.POST I'm using htmx to make post request

6👍

Did you add/set hx-encoding to multipart/form-data?

According to the docs https://htmx.org/docs/#files

If you wish to upload files via an htmx request, you can set the hx-encoding attribute to multipart/form-data. This will use a FormData object to submit the request, which will properly include the file in the request.

Leave a comment