Skip to content

Can't post formdata ;type= with number #15761

Closed
@IcedCoffeee

Description

@IcedCoffeee

I did this

curl -X POST -F "file=@video.mp4;type=video/mp4" https://example.com
curl: (26) Failed to open/read local data from file/application

and

curl -F "data=test;type=test/test1" https://example.com
Warning: garbage at end of field specification: 1

however, removing the number in either of the types stops that error from occurring and uploads the file/data as expected.

I expected the following

This used to work, but from searching around a bit, I think this is what's causing the issue

while(*p && (ISALPHA(*p) || (*p == '/') || (*p == '-')))

which got changed in 9664d5a and would explain why it stopped working recently.

curl/libcurl version

curl 8.11.1 (x86_64-pc-linux-gnu) libcurl/8.11.1 OpenSSL/3.4.0 zlib/1.3.1 brotli/1.1.0 zstd/1.5.6 libidn2/2.3.7 libpsl/0.21.5 libssh2/1.11.0 nghttp2/1.64.0 nghttp3/1.6.0

operating system

Arch Linux

Activity

self-assigned this
on Dec 17, 2024
bagder

bagder commented on Dec 17, 2024

@bagder
Member

That's my silly mistake. I'll fix.

added a commit that references this issue on Dec 17, 2024
4e4bc98
added a commit that references this issue on Dec 17, 2024
f7e065f
added a commit that references this issue on Apr 26, 2025
b8adff6
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

    Development

    Participants

    @bagder@IcedCoffeee

    Issue actions

      Can't post formdata ;type= with number · Issue #15761 · curl/curl