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

114
Views
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
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!