Skip to content

Added part about serialization issues when using file-upload in non-API context #2160

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

Open
wants to merge 1 commit into
base: 4.1
Choose a base branch
from

Conversation

PaddyS
Copy link

@PaddyS PaddyS commented May 6, 2025

Added part about serialization when using a file upload with the User entity, which gets serialized by Symfony for the session.

Ignoring this will result in an PHP exception when trying to upload a file to the User entity via the Symfony form builder.

To be fair, this is not exactly an API platform issue, since the upload via API works flawlessly even without this change.
I just happened to face this issue in this context, and found several other public posts about people using API platform facing the same issue.

It's totally fine if you don't want to have that part in your documentation though!

@PaddyS PaddyS changed the title Update file-upload.md Added part about serialization issues when using file-upload in non-API context May 6, 2025
Added part about serialization when using a file upload with the User entity, which gets serialized by Symfony for the session.
@soyuka
Copy link
Member

soyuka commented May 7, 2025

Indeed this looks like it should be in Symfony's documentation, what do you think?

@PaddyS
Copy link
Author

PaddyS commented May 7, 2025

Yeah, unfortunately I did not find a fitting Symfony documentation that actually takes care of VichUploaderBundle, besides mentioning it in a sidenote.

I could imagine it here otherwise, in VichUploaderBundle's own documentation, maybe here:
https://github.com/dustin10/VichUploaderBundle/blob/master/docs/known_issues.md

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

Successfully merging this pull request may close these issues.

2 participants