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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T12:30:54+00:00 2026-06-16T12:30:54+00:00

I have been trying to style an input type="file" field. My button is styled

  • 0

I have been trying to style an input type="file" field.
My button is styled but I can’t seem to figure out how to get the filepath/file to show when the user selects the file to upload.
Can anyone out there help?

.file-upload {
  overflow: hidden;
  display: inline-block;
  position: relative;
  vertical-align: middle;
  text-align: center;
  color: #fff;
  border: 2px solid #707070;
  background: #A0A0A0;
  -moz-border-radius: 8px;
  -webkit-border-radius: 8px;
  border-radius: 8px;
  text-shadow: #000 1px 1px 4px;
  cursor: pointer;
}

.file-upload:hover {
  background: #2FA2FF;
}

.file-upload.focus {
  outline: 2px solid yellow;
}

.file-upload input {
  position: absolute;
  top: 0;
  left: 0;
  margin: 0;
  font-size: 12px;
  opacity: 0;
  filter: alpha(opacity=0);
  z-index: -1;
}

.file-upload span {
  position: absolute;
  top: 0;
  left: 0;
  display: inline-block;
  padding-top: .45em;
}

.file-upload {
  height: 38px;
}

.file-upload,
.file-upload span {
  width: 160px;
}

.file-upload-status {
  margin-left: 10px;
  vertical-align: middle;
  padding: 7px 11px;
  font-weight: bold;
  font-size: 16px;
  color: #888;
  background: #f8f8f8;
  border: 3px solid #ddd;
}
<form action="" method="POST" enctype="multipart/form-data">
  <div class="fileupload-buttonbar">
    <label class="file-upload"><span>Upload....</span><input name="uploadfile" type="file"> </label>
  </div>
</form>
  • 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-06-16T12:30:55+00:00Added an answer on June 16, 2026 at 12:30 pm

    Add a change event to the input field, and then just get it’s .value.

    Example (using jQuery):

    $('input[name="uploadfile"]').change(function(){
        var fileName = $(this).val();
        alert(fileName);
    });
    

    DEMO: http://jsfiddle.net/hjNEC/2/

    EDIT: Since the input field is hidden, and the file name is part of that, you’re gonna have to display fileName on the page yourself.

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

Sidebar

Related Questions

I have been trying to highlight a radio button with CSS but have been
I have been trying to change the cursor style to look like a pointer
Have been trying to encrypt an xml file to a string so that I
I have been trying to create a ListView which I can sort using drag
I have been trying to figure this out for a few days now and
I have been trying to change so I get the push from a input
I have been trying to program a UNIX style shell command prompt in C.
Ive been trying to style a submit button using an image. I would use
Have been trying to add a custom button for about 2 hours and I
I have a Submit button which I'm trying to replace with an image <input

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.