Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

429
Views
¿Cómo mostrar la imagen de api en django?

Tengo una respuesta API que contiene varias imágenes. Estoy usando el servicio de obtención para obtener el texto y las imágenes en el formulario. El texto está llegando, pero tengo dificultades para recuperar imágenes de la API. no se muestra

El valor clave de la API para mi imagen es:-***

result_data_for_editing.media.mediaPath


Mi HTML donde quiero recuperar mi imagen es: -

 <img type="file" id="files" multiple name="media" accept="image/*"/> <output id="list" value="result_data_for_editing.media.mediaPath"></output>

y el javascript correspondiente para crear miniaturas para esa imagen es: -

 $(document).on('click', '.browse', function () { var file = $(this).parent().parent().parent().find('.file'); file.trigger('click'); }); $(document).on('change', '.file', function () { $(this).parent().find('.form-control').val($(this).val().replace(/C:\\fakepath\\/i, '')); }); //function to create thumbanil of images uploaded on client-side function handleFileSelect(evt) { $("#list").html(""); var files = evt.target.files; // FileList object // Loop through the FileList and render image files as thumbnails. for (var i = 0, validatedfiles, f; f = files[i], validatedfiles = files[i]; i++) { var reader = new FileReader(); var imagearray = []; imagearray = files[i]; // Closure to capture the file information. reader.onload = (function (theFile) { return function (e) { // Render thumbnail. var span = document.createElement('span'); span.innerHTML = ['<img class="thumbs_image" src="', e.target.result, '" title="', escape(theFile.name), '"/>'].join(''); document.getElementById('list').insertBefore(span, null); }; })(imagearray); // Read in the image file as a data URL. reader.readAsDataURL(imagearray); } }

Gracias por adelantado

over 4 years ago · Santiago Trujillo
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!