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

  • Home
  • SEARCH
  • 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 7019501
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T23:11:31+00:00 2026-05-27T23:11:31+00:00

How do I turn the div with id uploadWrapper from this jsFiddle into a

  • 0

How do I turn the div with id “uploadWrapper” from this jsFiddle into a button that can upload images – basically doing the same as <input type="file">. Thanks in advance.

EDIT – DUE TO ANSWERS RECEIVED

How can I show a preview of the image in the place of the div with the blue background when someone uploads an image, see this jsFiddle

  • 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-27T23:11:31+00:00Added an answer on May 27, 2026 at 11:11 pm

    This is not as easy to do as one would imagine, and some browsers prevent triggering file uploads from untrusted elements automatically for security purposes.

    I recommend using a third party file upload plugin, such as Plupload, or faking a custom button using progressive enhancement (invisible file upload button, with a custom graphic under it (of course not the most flexible of solutions) as described here:

    http://filamentgroup.com/lab/jquery_custom_file_input_book_designing_with_progressive_enhancement/


    Plupload events allows you to hook into the events that might occur during ajax file upload, and do stuff with the upload info. See this page on examples of what response data you might get:

    http://www.plupload.com/example_events.php

    You can get response data like this:

    id=p16in5el9ne2fc1rd08120in081
    name=denim.png
    size=20623
    loaded=20623
    percent=100
    status=DONE
    target_name=p16in5el9ne2fc1rd08120in081.png
    

    And of course you can modify what the server returns on a successful upload, to be able to get the full absolute URL to the uploaded image.

    After you have this data, you can hook into it and switch the image doing something like this (with jQuery):

    // Called when a file has finished uploading
    FileUploaded: function(up, file, info) {
        $('#id_of_the_image').attr('src', 'uploads/' + file.target_name);
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

How can you turn a floated div into an absolutely positioned one in the
I want to turn the JavaScript in this example into jQuery. Basically I've jerry-rigged
Hey all, I basically output content into a div like this using jquery: var
I am trying to turn div#sidebar into a sidebar in my app. My code
I googled how to turn a div into a link but there seem to
I want to show different images in a DIV, the turn of an image
I have page loading, via AJAX a PHP page into a div. In turn,
I have HTML that looks like this: <div class=item-list> <h3>Monday Sep 21</h3> <h3>Tuesday Sep
I have a page that uses jquery to turn an html table into a
I'm trying to turn a div into a link. The code below works fine

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.