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

104
Vistas
Upload file to website and display it without refreshing site ASP.NET Core 6

I am trying to upload a file to my website and preview it without making the website refresh, but I cannot figure out how to do it, right now I select a file with the <input type=file> but I have a JQuery script that onchange submits the input with this code:

document.getElementById('file-upload').onchange = function () {
    document.getElementById("upload-form").submit();
};

How can I make this without refreshing the page after the POST? My Form looks like this (It is an ASP.NET Core 6 project):

<form id="upload-form" asp-action="UploadFile" asp-controller="Home" enctype="multipart/form-data">
                <label for="file-upload" class="custom-file-upload">
                    <i class="fa fa-cloud-upload"></i> Ladda upp
                </label>
                <input id="file-upload" type="file" name="stlFile" />
            </form>
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