How to get an image of the view (html) and send it to a controller (php) using codeigniter?

0

I need to pass an image of my view to the controller , just the string with the url or the entire html element. I am using angular and codeigniter and the mpdf is not letting me generate through AJAX request, I'm throwing the parameters directly into the URL and resolving the route through routes.php to directly call a function in the controller, to generate the pdf, the problem is that the URL of my image is what google generates for PNG image of google charts , it's gigantic and I can not do it right in the URL like the other parameters, can anyone help me?

    
asked by anonymous 27.03.2018 / 18:51

1 answer

1

Sending via POST with jQuery:

var img_url = 'linkgeradoGcharts'
$.post( "suarota", { img: img_url } ).done(function(data){
   alert(data)
})

Getting the request in CodeIgniter:

link

$this->input->post('img');

    
27.03.2018 / 20:13