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

130
Views
¿Hay alguna API como para cargar una imagen desde nuestro dispositivo y convertirla en una URL de imagen?

Estoy creando un programador de publicaciones de Instagram para el que necesito una API desde la cual podamos seleccionar imágenes de nuestro dispositivo y luego esa API convierte esa imagen en una URL para que pueda usarla para publicar mi solicitud en Instagram.

Si hay alguna manera de hacer esto por favor ayúdame.

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

El sitio imgur proporciona una API para automatizar esto. Aquí hay un código de demostración:

 $('document').ready(function () { $('input[type=file]').on('change', function () { var $files = $(this).get(0).files; if ($files.length) { // Reject big files if ($files[0].size > $(this).data('max-size') * 1024) { console.log('Please select a smaller file'); return false; } // Begin file upload console.log('Uploading file to Imgur..'); // Replace ctrlq with your own API key var apiUrl = 'https://api.imgur.com/3/image'; var apiKey = 'ctrlq'; var settings = { async: false, crossDomain: true, processData: false, contentType: false, type: 'POST', url: apiUrl, headers: { Authorization: 'Client-ID ' + apiKey, Accept: 'application/json', }, mimeType: 'multipart/form-data', }; var formData = new FormData(); formData.append('image', $files[0]); settings.data = formData; // Response contains stringified JSON // Image URL available at response.data.link $.ajax(settings).done(function (response) { console.log(response); }); } }); });

** pero para usar su procedimiento, debe registrar su aplicación y boom. Aquí está su documentación.

https://www.labnol.org/code/20526-javascript-image-uploader

about 4 years ago · Juan Pablo Isaza Report
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!