Click here to Skip to main content
16,021,687 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hii,
I take one browse button using file upload. A link button to remove. one image control for displaying the image.
After browsing image or file using file upload I want that image immediately in image control(i.e. display on same page).
after clicking on remove the browsed should remove and image should also get remove.
after browsing image it should show only the image name not whole path.
At the end on click on submit button it save in database.
Posted
Comments
asplover1 14-Oct-15 1:09am    
Thaks to all. I done it using onChange event of fileUpload control.
On Onchange I give a path of browsed image to imgUrl.

I have created one fiddle for your question may be this will help you...

http://jsfiddle.net/Amit_Jadli/uk3vL6f1/[^]
 
Share this answer
 
Comments
asplover1 13-Oct-15 8:08am    
Thanx for reply. I tried It, but it doesn't work. the browse button look like a file upload and the preview is not displayed
F-ES Sitecore 13-Oct-15 8:10am    
The browser you're using probably doesn't support html5 fileapi then.
Look at the "Reading files" demo

http://www.html5rocks.com/en/tutorials/file/dndfiles/[^]

Note this is only possible if the browser supports html5, for non-html5 browsers you'll need a client plug-in like flash or java to do this.
 
Share this answer
 
Comments
njammy 13-Oct-15 5:32am    
Are you allowed to or able to use Javascript client side to achieve this?
asplover1 13-Oct-15 6:20am    
no. Actually I dont know how to allow javascript

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900