Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

170
Visualizações
get the full path of the selected image

I am trying to get the full path of the image but do not know how to do this? This is my jquery code::

$(document).ready(function () {
    $('#i_image').change(function () {
        var file = this.files;

        if (file && file[0]) {
            ReadImage(file[0]);
        }
    });

    var ReadImage = function (file) {
        var reader = new FileReader;
        var image = new Image;

        reader.readAsDataURL(file);
        reader.onload = function (_file) {
            image.src = _file.target.result;
            
            image.onload = function () {
                var height = this.height;
                var width = this.width;
                var type = file.type;
                
                
                $('#i_targetImg').attr('src', _file.target.result);
                
                $('#i_imagePrvw').show();
                // trying to get full path of the selected image...
                var fullPath = $('#i_targetImg').attr('src');
                $('#i_full_path').text(fullPath);
                
            }
        }
    };
});

var clearPreview = function () {
    $('#i_image').val('');
    $('#description').text('');
    $('#i_imagePrvw').hide();
};

front end code::

<div id="i_imagePrvw" class="thumbnail" style="display:none">
                                    <img class="img-responsive" id="i_targetImg" style="display:block; object-fit:fill;height:140px;width:120px;" />
                                    <div class="caption">
                                        <a href="#" onclick="clearPreview()"><i class="glyphicon glyphicon-trash"></i></a>
                                        
                                        <p id="i_full_path"></p>
                                    </div>
                                </div>
about 4 years ago · Juan Pablo Isaza
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda