How do I upload multiple files/images from the client to the server using Java?
-
Here is a sample of the code I am using: function cropImageSave(){ var imageData = $('#item-image').attr('src'); var imageName = $('#upl_input').val(); alert("imageData" + imageData); alert("imageName" + imageName); $.ajax({ type: 'post', url: 'cropImage.htm', processData: false, contentType: application/json, data:{imageData1:JSON.stringify(imageData)}, success:function(result){ alert(result); } }); With this code, I get imageData and imageName in Base64 format, but I am unable to send it to a controller in http://en.wikipedia.org/wiki/Spring_Framework.
-
Answer:
function(img) { i = new Image(); i.src = img; $(this).appned(i); }, $.ajax({ type: 'post', dataType: 'image/gif', error: function(error, txtStatus) { } }); Idea is to use new Image() instance to add the image and send it to Ajax
Venu Gopal Reddy Muvva at Quora Visit the source
Related Q & A:
- How do I issue multiple commands using telnet or netcat?Best solution by Super User
- How do i get multiple images?Best solution by Stack Overflow
- How can i upload my photos to yahoo images and watch it in my search results?Best solution by Yahoo! Answers
- How do I upload multiple files into a folder?Best solution by Yahoo! Answers
- How can I upload images to Wikipedia?Best solution by Yahoo! Answers
Just Added Q & A:
- How many active mobile subscribers are there in China?Best solution by Quora
- How to find the right vacation?Best solution by bookit.com
- How To Make Your Own Primer?Best solution by thekrazycouponlady.com
- How do you get the domain & range?Best solution by ChaCha
- How do you open pop up blockers?Best solution by Yahoo! Answers
For every problem there is a solution! Proved by Solucija.
-
Got an issue and looking for advice?
-
Ask Solucija to search every corner of the Web for help.
-
Get workable solutions and helpful tips in a moment.
Just ask Solucija about an issue you face and immediately get a list of ready solutions, answers and tips from other Internet users. We always provide the most suitable and complete answer to your question at the top, along with a few good alternatives below.