Solved

Displaying the selected file that the user chooses to upload.

Posted on 2000-04-19
1
175 Views
Last Modified: 2010-04-09
I am looking for help on how I can display the gif,jpg, etc. that the user selects to upload.

I allow a user to upload a picture

<input type="file" name="smallimgfile">

When the user selects a file, I would like to display the image before they hit the submit button.  This will allow them to verify that they selected the correct picture.
<imgsrc="whateverfile the user selected" alt="" border=0>

FYI...I am using coldfusion.
0
Comment
Question by:dualdragon
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
1 Comment
 
LVL 5

Accepted Solution

by:
Jan Louwerens earned 100 total points
ID: 2732948
For security reasons, there is no way to access files on the client machine (including images). So there is no way to do exactly as you are describing. You can, however, display the image once it has been uploaded to the server using the file input tag. So you can't really have them preview it before uploading it, but you can have a 2 step process where they upload the file, and then you display that file, asking them if it is the file they meant to send.
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Building a website can seem like a daunting task to the uninitiated but it really only requires knowledge of two basic languages: HTML and CSS.
This article demonstrates how to create a simple responsive confirmation dialog with Ok and Cancel buttons using HTML, CSS, jQuery and Promises
HTML5 has deprecated a few of the older ways of showing media as well as offering up a new way to create games and animations. Audio, video, and canvas are just a few of the adjustments made between XHTML and HTML5. As we learned in our last micr…
Learn how to create flexible layouts using relative units in CSS.  New relative units added in CSS3 include vw(viewports width), vh(viewports height), vmin(minimum of viewports height and width), and vmax (maximum of viewports height and width).

726 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question