Skip to content

Problem with send multipart form data in method PUT #36146

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

Closed
kamil-nawrotkiewicz opened this issue Mar 20, 2020 · 4 comments
Closed

Problem with send multipart form data in method PUT #36146

kamil-nawrotkiewicz opened this issue Mar 20, 2020 · 4 comments

Comments

@kamil-nawrotkiewicz
Copy link

Symfony version(s) affected: 4.4.5

Description
Hi, I'm using symfony 4 versions and I have a problem with requests in the PUT multipart form data method. Unfortunately, the Request object is empty. $reques->request->all().

Possible Solution
At the moment I have changed the method from PUT to POST that works.

@Nyholm
Copy link
Member

Nyholm commented Mar 20, 2020

Hey.
Could you show some example code?

@derrabus
Copy link
Member

This is not a bug.

$request->request leverages a php feature, the superglobal $_POST variable to be precise. If php receives form data via POST, the request body is parsed and the $_POST variable is populated automatically. However, this is not the case for PUT requests.

Now, Symfony could emulate that functionality, but I don't think that this is a good idea because it'll introduce a performance penalty to a very central framework component.

@xabbuh
Copy link
Member

xabbuh commented Mar 28, 2020

Let's close then as explained.

@xabbuh xabbuh closed this as completed Mar 28, 2020
@malantb
Copy link

malantb commented Mar 28, 2020

Duplicate of #9226.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants