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

165
Views
El archivo descargado usando blob en iOS Chrome cambió el nombre y el tipo de extensión a document.data

Estoy tratando de generar un archivo ics y permitir que el usuario lo descargue. Funciona en todos los navegadores excepto iOS Chrome y Firefox. iOS Chrome descargará el archivo, pero cambiará el nombre a documento y extensión de datos. ¡Alguien sabe cuál es el motivo y me ayuda, por favor!

 const iOS = (/iPad|iPhone|iPod/.test(userAgent) || (navigator.platform === 'MacIntel' && navigator.maxTouchPoints > 0)) && !window.MSStream; var icsMSG = 'BEGIN:VCALENDAR\n' + 'VERSION:2.0\n' + 'PRODID:-//...//NONSGML ...//EN\n' + 'METHOD:PUBLISH\n' + 'BEGIN:VEVENT\n' + `SUMMARY:${appointment?.location?.clinicName} Appointment for ${identity.firstName} ${identity.lastName}\n` + 'ORGANIZER;CN=abc\n' + `DTSTART:${startTime}\n` + `DTSTAMP:${startTime}\n` + `LOCATION:${location}\n` + 'BEGIN:VALARM\n' + 'TRIGGER:-PT30M\n' + 'REPEAT:1\n' + 'DURATION:PT15M\n' + 'ACTION:DISPLAY\n' + 'DESCRIPTION:Reminder\n' + 'END:VALARM\n' + `DESCRIPTION:${appointment?.care?.caretype}; Estimated length: ${ appointment?.care?.estTime } minutes; Provider: ${appointment.provider.name}, ${ appointment.provider.type }; Estimated cost: ${!hasInsurance ? 'without insurance' : ''} ${ appointment?.care?.estCost }\n` + 'END:VEVENT\n' + 'END:VCALENDAR'; var blob = new Blob([icsMSG], { type: 'text/calendar;charset=utf-8' }); if (iOS) { var reader = new FileReader(); reader.onload = function (e) { window.location.href = reader.result; }; reader.readAsDataURL(blob); } else { const url = window.URL.createObjectURL(blob); const link = document.createElement('a'); link.href = url; link.download = 'calendar.ics'; // TODO: Try to not use blob but replace https with webcal so calendar can open automatically document.body.appendChild(link); link.click(); document.body.removeChild(link); }```
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!