I think the Content-Type header in the request is missing the boundary parameter, leading to the .disp method not seeing the « file » part
Here is an example :
POST /upload HTTP/1.1
Content-Type: multipart/form-data; boundary=----WebKitFormBoundary7MA4YWxkTrZu0gW
------WebKitFormBoundary7MA4YWxkTrZu0gW
Content-Disposition: form-data; name="username"
john_doe
------WebKitFormBoundary7MA4YWxkTrZu0gW
Content-Disposition: form-data; name="profile_picture"; filename="profile.jpg"
Content-Type: image/jpeg
[Binary data of the JPEG file]
------WebKitFormBoundary7MA4YWxkTrZu0gW
Content-Disposition: form-data; name="metadata"
Content-Type: application/json
{"age": 30, "location": "New York"}
------WebKitFormBoundary7MA4YWxkTrZu0gW--j- Log in to post comments

.png)