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

Fix the "doctrine file uploads" cookbook examples, see symfony/symfony-d... #2120

Merged
merged 7 commits into from
Mar 30, 2013

Conversation

mahmouds
Copy link
Contributor

I did a rename on "filenameForRemove" to "temp" as it holds only the extension of the file in the "Using the id as the filename" section but I am ok with any other suggestions.

$this->file = $file;
// check if we have an old image path
if (is_file($this->getAbsolutePath())) {
//store the old name to delete after the update
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

a space needed here

@mahmouds
Copy link
Contributor Author

Thanks again @wouterj

@wouterj
Copy link
Member

wouterj commented Jan 11, 2013

@mahmouds you're welcome. You should end short descriptions in PHPdoc comment with a ..

@weaverryan
Copy link
Member

Related issue #600

@winzou
Copy link

winzou commented Feb 11, 2013

When using the id, in upload method you have to delete the old file before moving the new one. Indeed, the name could be the same (same id, same extension), so actually you might be deleting the new uploaded file.

@mahmouds
Copy link
Contributor Author

@winzou thanks for the tip I have just updated the PR.

@weaverryan weaverryan mentioned this pull request Mar 23, 2013
1 task
@weaverryan weaverryan merged commit 15ccf24 into symfony:2.0 Mar 30, 2013
@weaverryan
Copy link
Member

Hi Mahmoud!

This has been merged in - I think that handling the "delete" is important. As you know, this whole document still needs to be heavily redone, which I've outlined in #2346.

Thanks!

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.

5 participants