php - Symfony Picture Download -
i have action download picture , post picture toamazons3 , set url amazons3 in db:
public function photouploadaction($username) { $em = $this->getdoctrine()->getmanager(); $request = $this->get('request'); $profilerepository = $this->get('artel.profile.developer.repository'); $developer = $profilerepository->findonebyusername($username); $developer_username = $developer->getusername(); if (!$developer) { throw $this->createnotfoundexception('unable find profile.'); } $authenticator = $this->get('artel.profile.authenticator'); if (!$authenticator->check($developer)) { throw new accessdeniedexception('access denied!'); } $url = sprintf( '%s%s', $this->container->getparameter('acme_storage.amazon_s3.base_url'), $this->getphotouploader()->upload($request->files->get('file'), $developer_username) ); $developer->setimage($url); $em->persist($developer); $em->flush(); return new response($url);
and need, if picture have size 1024x768 or more, have change one-size-height proportional width of 150. how this. ways solve problem?
Comments
Post a Comment