public webcamUploadAction ( |
||
$request | The request to process | |
return |
public function webcamUploadAction(Request $request)
{
$image = new TempImage();
$imageService = $this->get('partkeepr_image_service');
$data = $request->getContent();
$base64 = explode(',', $data);
$imageService->replaceFromData($image, base64_decode($base64[1]), 'webcam.png');
$this->getDoctrine()->getManager()->persist($image);
$this->getDoctrine()->getManager()->flush();
return $image;
}