Created
January 19, 2015 15:12
-
-
Save toolpixx/504558a3e0e3fbc9738e to your computer and use it in GitHub Desktop.
Simple move attachment with symfony2
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
...other stuff before.... | |
/** | |
* | |
* use Symfony\Component\HttpFoundation\File\UploadedFile as UploadedFile; | |
* | |
* $message is instanceof \Swift_Message::newInstance() | |
* $enquiry is instanceof EnquiryEntity | |
* $enquiry->getAttachment() is the file-attribute for upload | |
* | |
*/ | |
if ($enquiry->getAttachment() instanceof UploadedFile) { | |
$enquiry->getAttachment()->move( | |
__DIR__.'/../../../../web/uploads', | |
$enquiry->getAttachment()->getClientOriginalName() | |
); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment