On Mar 2, 5:46 am, "finecur" <fine...@yahoo.comwrote:
I am working on the project. Here is the work flow.
From a web page, user will upload a Microsoft Excel file to the
server. The server will do some calculation based on the data in the
file and return an image in Jpg format. The returned image will be
displayed at the same web page. I do not want to refresh the page so
that the user get better experience.
How can I do it?
Thanks,
ff
Use AJAX, it's already a used-up question. Upload the file in
background, using the post method, and receive the response from the
same AJAX handler. Once you receive the response, you can handle it at
will.
However, the image part is tricky. The html image-tags don't receive
source as binary data, but rather (and only) as the string referring
to the address of the image, whether it's a static image or server-
generated image. So, you can't get binary data from the ajax response
that you would "insert" into the image container, but you can only
maybe get ajax to respond with a url of the image and set that to be
the source of the image in the page.