Skip to content

Instantly share code, notes, and snippets.

@gbasov
Last active December 12, 2015 04:39
Show Gist options
  • Save gbasov/4716339 to your computer and use it in GitHub Desktop.
Save gbasov/4716339 to your computer and use it in GitHub Desktop.
<?php
public function executeVkUploadFile(sfWebRequest $request)
{
$this->forward404Unless($request->isXmlHttpRequest() && $request->isMethod(sfRequest::POST));
$this->forward404Unless($t_participant = Doctrine::getTable('TParticipant')->find($request->getParameter('id')));
$url = $request->getParameter('url');
$file = $t_participant->getResizedPath();
$curl = new cURL($url);
$response = $curl->post([ 'photo' => '@' . $file ]);
return $this->renderText($response);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment