0

In my controller i receive a image url in blob

https://adonai.eduxenet.com.br/290beb51-094f-4f6a-bd9f-a37cf49d1c25" >

I've tried in several ways to get the image and I can not

how can I get this image and save it to my server?

 public function store(Request $request)
{

    $detail=$request->layoutDocumento;
    debug_var($detail);


    $dom = new \domdocument();
    @$dom->loadHtml(utf8_decode($detail), LIBXML_HTML_NOIMPLIED | LIBXML_HTML_NODEFDTD);

    $images = $dom->getelementsbytagname('img');


    foreach($images as $k => $img){
        $data = $img->getattribute('src');

        //list($type, $data) = explode(';', $data);
        //list(, $data)      = explode(',', $data);

        //$data = base64_encode($data);


        $uploadArquivo = $this->salvaDocumento(\Session::get('app.cliente_id'),
                                           \Session::get('id_unidade_selecionada'),
                                            $request->id_categoria ,
                                            $request->id_documento ,
                                            $blob);

        debug_var($uploadArquivo);

        $imagem_url = \Config::get('app.storage') . '/' . $uploadArquivo;
        $img->removeattribute('src');
        $img->setattribute('src', $imagem_url);
    }


    $detail = $dom->savehtml();


    $documento = new Documento;
    $documento->id_tipo_documentos = $request->id_documento;
    $documento->st_vingente = '1';
    $documento->st_matricula = '1';
    $documento->tp_layout = 'portrait';
    $documento->layout = $detail;
    $documento->save();
    \Session::forget('msg_documentos');
    \Session::put('msg_documentos', "Documento salvo com sucesso !");
    return redirect()->back();

}
7
  • How is the data being passed? Commented Jan 11, 2019 at 14:55
  • is a HTML editor i want store the images content inside Commented Jan 11, 2019 at 14:56
  • i receive <img alt="" src="blob:mydomain/290beb51-094f-4f6a-bd9f-a37cf49d1c25" width="270"> Commented Jan 11, 2019 at 14:56
  • OK, can you show me your route and controller code in the question please? Commented Jan 11, 2019 at 14:57
  • i receive a normal html <figure class="easyimage easyimage-full"><img alt="" src="blob:mydomain/290beb51-094f-4f6a-bd9f-a37cf49d1c25" width="270"> <figcaption></figcaption> </figure> Commented Jan 11, 2019 at 15:02

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.