Keloo
Keloo

Reputation: 1408

How to forward POST request with adding file parameters in Symfony?

I need to forward a POST request in Symfony but before forwarding I need to convert an image from base64 to $_FILES parameter. How can I do this?

Upvotes: 1

Views: 800

Answers (1)

ckifer
ckifer

Reputation: 284

Are you submitting a form before you forward? If you are you can do:

if($form->isSubmitted() && $form->isValid){
    //Do whatever work you need to in here like uploading the image 
    // before the forward
    return $this->forward('@Bundle:action', array(
       'request' => $request));
}

As for converting your file take a look at the answer to this question. It should do the trick. Hope this helps!

Upvotes: 3

Related Questions