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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T21:55:01+00:00 2026-05-25T21:55:01+00:00

I have a thumbnail interface mockup, and I would like to add the ability

  • 0

I have a thumbnail interface mockup, and I would like to add the ability to upload an image. According to my mockup, the interface looks like this:

Thumbnail interface

The intent was that the user would click on the “Add Icon” button, and a file dialog would pop up, just like the one that pops up when a file input is clicked. I would like the use the W3C’s File API to handle the file upload asynchronously, and display the thumbnail in the gray area above the button once the upload is complete.

So, I’d like to upload a file without using a file input HTML element. I tried working with a hidden file input element and calling its click event handler with Javascript when the “Add Icon” button is clicked, but the call didn’t do anything. I think security might have some reason to do with this.

Has anyone had any luck using an HTML button to upload a file before?

  • 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-25T21:55:02+00:00Added an answer on May 25, 2026 at 9:55 pm

    The trick I always do is wrapping the hidden file input into a label tag and then putting my custom input elements in the label tag. By defenition clicking on anything inside the label tag should trigger the input inside. No JavaScript needed at all!

    <label>
        <div>
            My custom file input
        </div>
    <input type="file" id="file"/>
    </label>
    

    CSS: input{visibility:hidden;} Please note that you can’t use display:none because then the element will not render. Still you can make the element width:0; height:0; to hide input element completely.

    Fiddle

    Using HTML file API is a little different. Read this article at Mozilla Developer Network to leran more.

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

Sidebar

Related Questions

I have this thumbnail list and would like push the image paths (sources) into
I have photo gallery code that does image re-sizing and thumbnail creation. I use
I have this script at the moment, which changes an image when a thumbnail
I have a thumbnail image that when you click it changes a larger image
I have a thumbnail image that when clicked changes a larger image on the
I have a thumbnail image inside a div. I use another image as the
I have the following code to take an image and generate the thumbnail. how
I want to add a thumbnail picture viewer to my application.I have been trying
I am wondering if it is possible to have a sort of thumbnail image
I have 7 thumbnail image menus.when user points (mouseover) to a particular thumbnail, I

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.