1
Good morning
People regarding the code I am trying to get an image that is in the bank and bring to the page, but it is not bringing the image(Consultation of patient registration).
For the inclusion of the patient registration with the photo, I am using the code below that is working right, but if I want to consult a record that has an image, what is wrong with the code below ?
On the estate defaultPreviewContent
the variable is being used $path
is the one that contains the directory + file name..
I’m not sure I’m making myself clear.
I’ll be waiting for you.
Roger
<script type="text/javascript">
var btnCust = '<button type="button" class="btn btn-default" title="Add picture tags" ' +
'onclick="alert(\'Call your custom code here.\')">' +
'<i class="glyphicon glyphicon-tag"></i>' +
'</button>';
$("#avatar-2").fileinput({
overwriteInitial: true,
maxFileSize: 1500,
showClose: false,
showCaption: false,
showBrowse: false,
browseOnZoneClick: true,
removeLabel: '',
removeIcon: '<i class="glyphicon glyphicon-remove"></i>',
removeTitle: 'Cancel or reset changes',
elErrorContainer: '#kv-avatar-errors-2',
msgErrorClass: 'alert alert-block alert-danger',
defaultPreviewContent: '<img src= $path alt="Your Avatar" style="width:160px"> <h6 class="text-muted">Click para selecionar</h6>',
layoutTemplates: {main2: '{preview} ' + ' {remove} {browse}'},
allowedFileExtensions: ["jpg", "png", "gif"]
could edit your question and add the code in writing? stackoverflow has the option to format the text as code
– Cedric S.
Oops, good morning. OK I edited the code, I don’t know if Oce understood ? Thank you
– Rogério dos Santos
that
$path
is returning something?– Tales Peres
Yes, it is returning the directory + the file name
– Rogério dos Santos
It is returning as follows: .. /img_cad_patient/4bb77467d1b8a75a05bdbb8bc1b14d4a.jpg
– Rogério dos Santos
concatenate the server url with the path from where the image is, meuservidor.com/img_cad_patient/4bb77467d1b8a75a05bdbb8bc1b14d4a.jpg for example
– Prostetnic Vogon Jeltz
But it’s local, my machine, it’s still in development...
– Rogério dos Santos
or it would look like this: 127.0.0.1/img_cad_patient/4bb77467d1b8a75a05bdbb8bc1b14d4a.jpg, this ?
– Rogério dos Santos
yes, as long as the image path is inside the application server.
– Prostetnic Vogon Jeltz