Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

@Multipart List<PartData> image uploaded failed, using @Body no issue at all #749

Open
hmy65 opened this issue Dec 11, 2024 · 2 comments
Open
Labels
bug Something isn't working

Comments

@hmy65
Copy link

hmy65 commented Dec 11, 2024

Ktorfit version

2.2.0

What happened and how can we reproduce this issue?

client:

 formData {
                append(
                    key = "image_uploaded",
                    value = fileBytes,
                    headers = Headers.build {
                        append(HttpHeaders.ContentType, "image/jpeg")
                        append(HttpHeaders.ContentDisposition, "filename=$fileName")
                    }
                )
            }

server:
move_uploaded_file($_FILES['image_uploaded']['tmp_name'], $save_path)

request log:
CONTENT HEADERS
-> Content-Length: 264
-> Content-Type: multipart/form-data; boundary=-29ba7bac7be92961eeb6d65e5b9fa25b018a-13264733-7a5b7dadb92921f61f886e-
BODY Content-Type: multipart/form-data; boundary=-29ba7bac7be92961eeb6d65e5b9fa25b018a-13264733-7a5b7dadb92921f61f886e-
BODY START
---29ba7bac7be92961eeb6d65e5b9fa25b018a-13264733-7a5b7dadb92921f61f886e-
Content-Disposition: form-data; name=""
Content-Length: 49

io.ktor.http.content.PartData$BinaryItem@1a503a68
---29ba7bac7be92961eeb6d65e5b9fa25b018a-13264733-7a5b7dadb92921f61f886e---

response log:
Undefined array key "image_uploaded"

What did you expect to happen?

fix @multipart

Is there anything else we need to know about?

if i use "@Body map: MultiPartFormDataContent", no issue at all

@hmy65 hmy65 added the bug Something isn't working label Dec 11, 2024
@hmy65
Copy link
Author

hmy65 commented Dec 24, 2024

@Foso

@hmy65
Copy link
Author

hmy65 commented Dec 24, 2024

same: #739
only @Body works, but @multipart doesn't work

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant