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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T04:44:00+00:00 2026-05-26T04:44:00+00:00

Is there a way to open file dialog box to upload a file, on

  • 0

Is there a way to open file dialog box to upload a file, on click of an button or an image, or an link..

for example :

<a href="" onclick="openDialogBox('fileID')....." /> Select File To Upload</a>
<input type="file" id="fileID" />

I need simpliest example which will work in all browsers. Id like to use pure javascript or ajax.

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

    This is the way I’ve dealt with just HTML & CSS

    (And I think it’s not necessary to call any javascript through):

    <style>
        span.browse_but { font-family:Arial; width:65px; height:20px; text-align:center; line-height:18px; margin:0px; font-size:10px; font-weight:bold;
                            border:1px solid #ccc; float:left; cursor:pointer; padding:0px; background:#eee; display:block; float:left; overflow:hidden; }
        span.browse_but font { font-size:16px; color:#c00; }
        span.browse_but input { position:absolute; cursor:pointer; right:0px; top:0px; height:20px; width:195px; margin:0px; opacity:0; filter:alpha(opacity=0); }
    </style>
    
    <span style="position:relative;" class="browse_but">
        <font style="font-weight:bold; color:#093; position:relative; top:2px; font-size:17px;">+</font> Pick a file
        <input name="F" type="file" value=""/>
    </span>
    

    See fiddle here : Deal with ugly browse button

    Strategy is to make a file-input with opacity=0 and position:absolute inside a container with position:relative. Thus, the input was invisible to user but when they click the container, the input click event will be triggered as expected.

    What you can do to make this fit your own needs :

    • Insert the image you want into the container & position it properly;
    • Change the size of the file-input & container to fit the image;

    Good luck!

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

Sidebar

Related Questions

Is there a way for a open file dialog to use the My Computer
Is there any way to copy all lines from open file to clipboard in
Is there a way to configure nautilus to open a file into an existing
Is there a way to allow an HTML file to open an application on
Is there a way to automatically open up the Windows Performance Options dialog using
is there any way to open OpenOffice with the URL when I click on
In the Open File Dialog and Open Project Dialog there is a short cut
Is there a way to open My Computer Properties from C# Windows Application? For
Is there a way to open/close (i.e. start-up/shut-down) a winform application via ASP.NET? I'm
Is there any way to open a broadcast bluetooth socket, take a listen and

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.