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 707671
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T04:18:17+00:00 2026-05-14T04:18:17+00:00

My testers have discovered that if you type free text into a file upload

  • 0

My testers have discovered that if you type free text into a file upload input then none of the buttons on the page work until that text is removed (so the page cannot be submitted).

I am able to replicate this with the following ASPX code (with no code behind):

<%@ Page Language="C#" AutoEventWireup="true" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
  <body>
    <form id="form1" runat="server">
      <div>
        <asp:FileUpload ID="fuTest" runat="server" />
        <asp:Button ID="btnSubmit" runat="server" Text="Submit" />
      </div>
    </form>
  </body>
</html>

(Note that I haven’t bound any handlers to the page; despite this, the page is submitted when the submit button is clicked only if no text is entered into the upload text box)

Is there any way to prevent users from typing free text into a file upload control? It seems that this is only possible in IE – Firefox and Chrome natively prevent text from being entered into upload input fields.

I’ve seen solutions elsewhere which suggest hiding input and replacing it with a label / button combo, but this seems like it might cause more problems and work inconsistently across browsers.

Any thoughts?

  • 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-14T04:18:17+00:00Added an answer on May 14, 2026 at 4:18 am

    As per @Jer’s suggestion, I was able to prevent input into the file upload without breaking any of the other functionality by handling keypress events on the upload. Using jQuery:

    $(document).ready() {
        $('input:file').keypress(function() {
          return false;
        });
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have the following routine that dumps a DataTable into an Excel worksheet. private
I have an app that connects to an external accessory via Bluetooth. Testers have
I have an App that I am building and I want testers. I saw
I need to get the last character of a string. Say I have testers
I have users table. There are three other tables: developers, managers, testers. All of
In order to improve my open source project, I need testers. I have created
I have something that looks like the following: [CoolnessFactor] interface IThing {} class Tester
A colleague suggested to the testers they enter javascript:resizeTo(1024,768); into the address bar after
i have a combinatoric problem as such: You are given N testers. Each tester
We have an WPF Application build on .net framework 3.5. Some testers find if

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.