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 Request Error #1068

Open
p30arena opened this issue Feb 13, 2024 · 3 comments · May be fixed by #1423
Open

MultiPart Request Error #1068

p30arena opened this issue Feb 13, 2024 · 3 comments · May be fixed by #1423
Assignees
Labels
bug Something isn't working goodfirstissue Standard GitHub label used for easy to resolve issues targeting beginner contributors WIP
Milestone

Comments

@p30arena
Copy link

The MultiPart body is malformed, the string value contains an additional \r\n and the server doesn't accept it when the values are validated.
Also, when uploading a file, "filename" is required by Django, but there is no way to provide additional keys and values to the message part.

@baywet
Copy link
Member

baywet commented Feb 13, 2024

Hi @p30arena
Thanks for using kiota and for reporting that.
I can see you've already started a PR, so I'll head over there to provide feedback.

@bugproof
Copy link

bugproof commented May 28, 2024

Same problem with ASP.NET Core and all the other web frameworks I guess... IFormFile is null and server doesn't accept it. I wasted 1+ hour looking for the solution and it was kiota serialization code fault. This bug is critical as it completely makes kiota clients useless for file uploads. I just used FormData and fetch as a workaround and much simpler too...

@andrueastman andrueastman modified the milestones: Kiota v1.15, Kiota v1.16 Jun 6, 2024
@fey101 fey101 added goodfirstissue Standard GitHub label used for easy to resolve issues targeting beginner contributors and removed Standard GitHub label labels Jun 6, 2024
@baywet baywet modified the milestones: Kiota v1.16, Kiota v1.17 Jul 5, 2024
@baywet baywet modified the milestones: Kiota v1.17, Kiota v1.18 Aug 9, 2024
@atigirb
Copy link

atigirb commented Aug 22, 2024

Same problem with ASP.NET Core and all the other web frameworks I guess... IFormFile is null and server doesn't accept it. I wasted 1+ hour looking for the solution and it was kiota serialization code fault. This bug is critical as it completely makes kiota clients useless for file uploads. I just used FormData and fetch as a workaround and much simpler too...

This issue seems to be happening due to missing file name in content disposition.
Added it inside the partName in addorReplacePart and seems to work. At least when only one file is being added.
But would be great to have an actual fix.

const body = new MultipartBody();
body.addOrReplacePart(`file"; filename="${file.fileName}`, file.contentType, file.content);

@baywet baywet modified the milestones: Kiota v1.18, Kiota v1.19 Sep 5, 2024
@shemogumbe shemogumbe linked a pull request Oct 16, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working goodfirstissue Standard GitHub label used for easy to resolve issues targeting beginner contributors WIP
Projects
Status: In Review 💭
9 participants