Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 595d6ef

Browse files
committed
Fix upload code
1 parent 647fd97 commit 595d6ef

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

cookbook/doctrine/file_uploads.rst

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -408,7 +408,7 @@ Next, refactor the ``Document`` class to take advantage of these callbacks::
408408
// the entity from being persisted to the database on error
409409
$this->getFile()->move($this->getUploadRootDir(), $this->path);
410410

411-
$this->setFile(null);
411+
412412

413413
// check if we have an old image
414414
if (isset($this->temp)) {
@@ -417,6 +417,7 @@ Next, refactor the ``Document`` class to take advantage of these callbacks::
417417
// clear the temp image path
418418
$this->temp = null;
419419
}
420+
$this->setFile(null);
420421
}
421422

422423
/**

0 commit comments

Comments
 (0)