Uploading files with fileinput

Asked

Viewed 99 times

0

I’m using the fileinput of this website Bootstrap: fileinput.js v3.1.3 and I need to get my BLOB of the image uploaded when submitting the form.

I observed that by doing the uplod from some image to tag img appears and in it is placed the BLOB. As in the image below:

Inspecionamento do html cujo código representa meu campo de upload de imagem.

My HTML codes are as follows:

<div class="col-sm-12">
 <div class="fileinput fileinput-new" data-provides="fileinput">
  <div class="fileinput-preview thumbnail" data-trigger="fileinput"><img class="img-responsive" src="{{$igreja->BLO_IMAGM_IGREJ}}" alt=""></div>
   <div>
    <span class="btn btn-info btn-file">
    <span class="fileinput-new">Selecionar foto</span>
    <input type="file" name="...">
    </span>
  <a href="#" class="btn btn-danger fileinput-exists" data-dismiss="fileinput">Remover</a>
  </div>
 </div>
</div>

I thought to do as follows, when uploading the file I set in a field with the property Hidden the blob of the image uploaded, and so I can recover this data there in my controller.

By way of curiosity I’m using the Laravel 5.3.

  • Retrieve the BLOB in the backend? But isn’t it fileinput.js' own job to send to the back end? I mean, where is it failing? Show the javascript part as you did

  • My part js this joint with api, exactly what I want, I want to set the image blob upada in any field.

  • I understood the fileinput does not upload, at least that is what it seems, I will try to see if it is possible to adapt it, however it seems to me better to review the use of this lib and think of something more functional.

  • @Guilhermenascimento, if you have something more interesting to present that will solve my problem, I would be very pleased.

  • Yes, I’m trying to formulate an answer that already works with Laravel, is that by not using Laravel I’m having to install ;) so I will answer as possible

  • @Guilhermenascimento if you want to put only as will be done in the front-end, can be, because catch with Aravel for me is quiet, I only need to set the value of the blob in a field, only this

Show 1 more comment
No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.