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

260
Views
Descargue el archivo de Excel devuelto en la interfaz

Tengo un problema para encontrar el código jQuery o JavaScript adecuado para permitir que los usuarios descarguen un archivo de Excel que se generó en el controlador API de C#, probé muchas formas diferentes y ninguna de ellas funcionó.

 public ApiResponse DownloadAllMembersFile(IEnumerable<IMember> members) { using (var workbook = new XLWorkbook()) { var worksheet = workbook.Worksheets.Add("AllMembers"); var currentRow = 1; #region Header worksheet.Cell(currentRow, 1).Value = "StudentId"; worksheet.Cell(currentRow, 2).Value = "Name"; worksheet.Cell(currentRow, 3).Value = "Email"; #endregion #region Body foreach (var member in members) { currentRow++; worksheet.Cell(currentRow, 1).Value = member.Id; worksheet.Cell(currentRow, 2).Value = member.Name; worksheet.Cell(currentRow, 3).Value = member.Email; } #endregion using (var stream = new MemoryStream()) { workbook.SaveAs(stream); var content = stream.ToArray(); return new ApiResponse( true,"done",File( content, "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet", "AllMembers.xlsx" )); } } }
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!