Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6618587
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T20:51:13+00:00 2026-05-25T20:51:13+00:00

As you can see my model (TestFileUploadModel) and my controller action (FileUpload) -> 3th

  • 0

My model:

My controller:

Before submit (file is selected)

After submit (file is cleared)

As you can see my model (TestFileUploadModel) and my controller action (FileUpload)

-> 3th screen before i submit: file is selected
-> 4th screen after i submit: name field is required, but file is cleared..

Anyone who was an idea how to solve this? (or a workaround?)

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-25T20:51:14+00:00Added an answer on May 25, 2026 at 8:51 pm

    As stated in the comment by user bzlm you can check with JQuery if the file has value and prevent the submit of the form.

    You can attach a function at the submit of your form and do this check

    if ($("#MyInputFileField").val()) { 
      //do your things
    }
    else
    {
      //PreventDefault and show error message
    }
    

    EDIT:
    Look here for an answer that should be similar to your question

    for an example using jquery validation plugin check this

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

As a non-logged in user, you can see one specific action of a model.
I have a failing model.save() in my Django app. How can I see the
I see that EF can update a model based on an existing database schema.
I am trying to convert my model-first project to code-first, as I can see
As you can see from code below. I am caching the show action. I
I can't get my controller involved when the request is fired. I see the
I have the following model, as you can see in the image. alt text
Consider the following property UserName of a Model Class. You can see that the
I can change the irb prompt mode with irb --prompt prompt-mode I can see
How can I remove the animation from this jQuery modal window? You can see

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.