Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

94
Vistas
Descargar XML recibido del controlador

Necesito descargar un XML recibido de un controlador, pero necesito el aviso para escribir el nombre y la ubicación donde se guardará el archivo. Primera pregunta: es óptimo enviar el xml como lo hice en este código o debería enviarlo como un archivo de alguna manera. Segunda pregunta: al recibir el xml o el archivo xml, ¿cómo puedo abrir el indicador y finalmente guardar el xml como un archivo?

 [HttpPost] public ActionResult ExportFiles(string clientName, string currenthcsystem) { try { var systemActionsConfigurationData = service.GetHcSystemActionsConfigurationData(clientName,currenthcsystem); XmlSerializer xsSubmit = new XmlSerializer(typeof(HcSystemActionsConfigurationData)); var xml = ""; using (var sww = new StringWriter()) { using (XmlWriter writer = XmlWriter.Create(sww)) { xsSubmit.Serialize(writer, systemActionsConfigurationData); xml = sww.ToString(); } } return Content(xml, "text/xml"); } catch (Exception) { throw; } } $('#exportButton').on("click", function () { var clientName = $(actionsButtons).data('clientname'); var currentHCSystem = $(actionsButtons).data('hcsystemname'); // Create FormData object var parameters = new FormData(); parameters.append("clientName", clientName); parameters.append("currentHCSystem", currentHCSystem); $.ajax({ url: $(actionsButtons).data('export'), type: 'POST', data: parameters, cache: false, processData: false, contentType: false, success: function (response) { //logic to open the prompt and finally download the xml }, error: function (err) { } }); });
about 4 years ago · Juan Pablo Isaza
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda