Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

JavaScript Forum


You are currently viewing our JavaScript Forum as a guest. Please register to participate.
Login



Reply
View image on selection by form.
Old 04-07-2007, 02:42 AM View image on selection by form.
The PHP Professor

Posts: 340
Name: Alex
Location: Behind You
Trades: 0
How do i view the image i selected through an upload form.

So in other words, when an image is selected in a file form, <input type="file">, the image could be displayed some where on the page?
__________________
Go Kirby! <(" . "<) (^" . "^) (>" . ")> Talkupation!
microcolt is offline
Reply With Quote
View Public Profile Visit microcolt's homepage!
 
 
Register now for full access!
Old 04-07-2007, 02:50 AM Re: View image on selection by form.
JeremyMiller's Avatar
WT Moderator

Posts: 1,712
Name: Jeremy Miller
Location: Las Vegas, NV
Trades: 0
Save the file locally (by accessing the $_FILES array) and then include an image reference to the newly-saved file. Be sure that you've selected the encoding type for file uploads.
JeremyMiller is offline
Reply With Quote
View Public Profile Visit JeremyMiller's homepage!
 
Old 04-07-2007, 02:52 AM Re: View image on selection by form.
ADAM Web Design's Avatar
Canadastaninianite

Posts: 5,935
Name: Adam for web page design, not program
Location: Toronto, Ontario, Canada
Trades: 0
If you did it with Javascript, you'd have to use AJAX. There's no built-in functionality for uploads within Javascript.

If you've got ASP knowledge and a server that can support it, check out ASPUpload by Persits Software. It's $150 (I think) but well worth every penny just for its image handling capabilities alone; it can detect what type of image was uploaded (or if one wasn't uploaded at all); the width, the height, and the file size. It's a cool little DLL and I use it quite a bit.
__________________

Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
(my blog)


Please login or register to view this content. Registration is FREE
(with proof)
ADAM Web Design is offline
Reply With Quote
View Public Profile Visit ADAM Web Design's homepage!
 
Old 04-07-2007, 07:33 PM Re: View image on selection by form.
ExpressoDan's Avatar
Ultra Talker

Posts: 317
Name: This Space for Rent
Location: Georgia
Trades: 0
I've actually recently researched this issue and have not found one good answer... Turns out that you can write some JavaScript that can display the image in the browser to the client from their local machine (img src="file:///c:\my documents\image.jpg" />. Sounds good, right? Would be great if it workded, but Javascript should not access the clients local file system as it's a security issue. This method only works on ie and all other browsers block this request.

The best solution is to upload the image to a server (asp, asp.net, php), let the client preview the image from your server and let them make changes, accept or delete from your server...
__________________

Please login or register to view this content. Registration is FREE

"I think therefore I am, I think." <!-- George Carlin
ExpressoDan is offline
Reply With Quote
View Public Profile Visit ExpressoDan's homepage!
 
Old 04-09-2007, 06:18 AM Re: View image on selection by form.
pitbull82's Avatar
Super Talker

Posts: 147
Name: Marcin Nabiałek
Location: Poland, Częstochowa
Trades: 0
You won't be able to display the image until it will be uploaded to server (via php, asp and so on)
__________________

Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
pitbull82 is offline
Reply With Quote
View Public Profile Visit pitbull82's homepage!
 
Reply     « Reply to View image on selection by form.
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.21142 seconds with 12 queries