views:

1541

answers:

5

Hello All, I am new to JQuery AJAX . I want to implement a file upload using a jquery. Will it be possible to make a fileupload with JQuery,AJAX and send it to Servlet which can use apache file commons to upload the file. Can anyone please advice me how to proceed further?

Thanks, Deepthi.

+4  A: 

Try Uplodify

Traveling Tech Guy
Yeah +1, I use it it's nice... that is all.
marcgg
Uplodify requires flash, which might not be suitable for some websites.
niaher
+1  A: 

This is not a jQuery solution but take a look at http://www.swfupload.org. I have used that component in the past to give the ajax / flickr like upload interface. Works great and is fairly easy to integrate into your site. There is a ton of demos at http://demo.swfupload.org too.

Jeff Widmer
A: 

Hi,

you can use Silverlight upload.

Grz, Kris.

XIII
He's using JSP/Servlet.
BalusC
+1  A: 

Ajax in the traditional sense is XMLHttpRequest, which does not allow you encode and send local files to a server.

The common ways of doing uploading through "ajax" means, is to either use a Flash swf to handle the uploading on the same page, or to use a form that has a target of an invisible 1x1 iframe. You have some Javascript show a uploading spinner or whichever. After the file is uploaded, make the server return some Javascript to the iframe like

<script type="text/javascript">
top.MyProject.doneUploading();
</script>

top will allow you to call Javascript in the regular page. In order for that to work though, you must make sure the iframe has submitted to the same domain that the top document is located at.

seanmonstar
+2  A: 

I had several problems using Uploadify so I turned to ajax upload

pedro