This is a migrated thread and some comments may be shown as answers.

[Solved] Load image and display image

2 Answers 101 Views
Upload
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Louis
Top achievements
Rank 1
Iron
Iron
Iron
Louis asked on 02 Dec 2011, 06:12 AM
Hello,

After my user upload an image, i need to display it.  Someone have an example to doing this?

Any help will be VERY appreciate.


2 Answers, 1 is accepted

Sort by
0
hn
Top achievements
Rank 1
answered on 04 Dec 2011, 01:20 AM
Once you have uploaded the image, return its path to the Success event handler of the uploader

in your code when receiving the image

return

 

 

Json(new { path = savedImagePath}, "text/plain");
this will be received by the success event of the uploader

 


 

 


function
onSuccess(e) {

 

document.getElementById(yourImageId).src = e.response.path;

 

 

}

0
Louis
Top achievements
Rank 1
Iron
Iron
Iron
answered on 04 Dec 2011, 06:27 PM
WOW work very fine.  Thank you A LOT!

Have nice day.
Tags
Upload
Asked by
Louis
Top achievements
Rank 1
Iron
Iron
Iron
Answers by
hn
Top achievements
Rank 1
Louis
Top achievements
Rank 1
Iron
Iron
Iron
Share this question
or