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

File Upload: Correctly instruct how to handle updates #600

Closed
weaverryan opened this issue Jul 30, 2011 · 3 comments
Closed

File Upload: Correctly instruct how to handle updates #600

weaverryan opened this issue Jul 30, 2011 · 3 comments
Labels

Comments

@weaverryan
Copy link
Member

Currently, if you follow the file upload cookbook, you will not be adequately handling "updates" for two reasons:

  1. If you only modify the file property, then the doctrine update listeners are not triggered
  2. If you do change the uploaded file, the old file is not deleted

Related is this commit, whose caution can hopefully be removed at some point: 808da21. Also, see #564.

@oscargala
Copy link

Today I came across the problem that the preupdate callback isn't triggered when you just change the $file attribute. Has there been any progress on this issue?

@Sgoettschkes
Copy link
Contributor

In the cookbook there is now a note stating that problem and also offering one workaround: http://symfony.com/doc/current/cookbook/doctrine/file_uploads.html#using-lifecycle-callbacks

Is this enough or is there a need for more detailed information? If so, what would be the best way (creating an advanced example with the way described in symfony/symfony#5150 or an extended note or maybe something else)?

@wouterj
Copy link
Member

wouterj commented May 13, 2013

closing this in favor of #2346, it's mentioned there so we don't loose the content of this one

@wouterj wouterj closed this as completed May 13, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants