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

128
Views
Uso de archivos de carga XMLHttpRequest (el sitio web funciona en la mayoría de los navegadores pero no funciona en el teléfono móvil iOS)

Estoy usando XMLHttpRequest para cargar imágenes en nuestro servidor, y funciona bien en (Firefox, Chrome y Safari) cuando uso una computadora de escritorio y una computadora portátil.

Al usar iPhone para cargar imágenes, falló sin errores. La siguiente es mi función de carga, y estoy luchando con muchas horas, por favor ayuda. Muchísimas gracias.

 function ajaxFileUpload() { var form = $('#imageform'); files = form.find('[type="file"]'); if (files.length == 0) { return; } var url = form.prop("action") $('#loading').show(); fileSelect = form.find('[type="file"]'); var files = fileSelect[0].files; var fd = new FormData(); for (var i = 0; i < files.length; i++) { var file = files[i]; //remove deleted images from previous start var is_img_removed = false; for (j=0; j<imgList_removed.length; j++) { if (imgList_removed[j] == file.name) { is_img_removed = true; break; } } if (is_img_removed == true) { continue; } //remove deleted images from previous end fd.append('fileToUpload', file); } var xhr = new XMLHttpRequest(); xhr.addEventListener('readystatechange', function(e) { if( this.readyState === 4 ) { form.find(":file").val(""); alert('upload successfully'); } }); xhr.open("POST", url, true); xhr.setRequestHeader('Accept-Encoding', 'multipart/form-data'); xhr.send(fd); return false; }
about 4 years ago · Juan Pablo Isaza
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!