Skip to content

File name not submitted with multipart/form-data #582

@Dronakurl

Description

@Dronakurl

Did you search for existing issues already?
yes

Describe the bug

I want to use slumber to upload a file to an endpoint with multipart/form-data.
Here are the parts of my config.

  test_h265_video:
    source: !file
      path: /home/ddt/regioncounter/faceswapper/test_h265.mp4
....
      upload_test_h265: !request
        name: Upload H.265 Test Video
        method: POST
        url: "{{server}}/api/videos/upload"
        headers:
          Accept: application/json
        authentication: !bearer "{{chains.auth_token}}"
        body: !form_multipart
          video: "{{chains.test_h265_video}};type:video/mp4"

In the upload, the "filename" is missing. I checked with curl:

curl -v -X POST "http://localhost/faceapi/api/videos/upload" \
        -H "Authorization: Bearer $(slumber request -p production login | jq -r .token)" \
        -H "Accept: application/json" \
        -F "video=@test_h265.mp4"

This is accepted by my endpoint.
The endpoint is an axum endpoint which expects Multipart and within the "video" field a filename in the "Content-Disposition" header.
I tried to pass this header, but there was still no filename found. Also, curl's verbose output does not show anything like this header, so I don't know where to explicitely include the filename in the slumber config.

To Reproduce
Please tell me, if I've got something wrong. If you are interested, I can provide a minimal reproducible example

Expected behavior
I would expected that slumber sends the form data exactly like curl does

Version (please complete the following information):

  • OS: Ubuntu 24.04
  • Terminal: alacritty
  • Slumber Version: 3.4.0

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions