I dont want to use jQuery, but id like to AJAX a file upload. is that possible?
if so, where could i find information / tutorial on it?
THANKS!
I dont want to use jQuery, but id like to AJAX a file upload. is that possible?
if so, where could i find information / tutorial on it?
THANKS!
No, it isn't possible to do this with javascript.
In order to give the 'AJAX' feel, however, you can submit a form to a hidden iframe and output the script results to it, then process from there. Google ajax iframe upload
and get started from there.
If you are using jQuery, there is also the Form plugin
which will automatically create this iframe for you if your form has any file fields in it. I haven't used it to do this, but I've heard good things.
As pointed out in the comments, you can also use something like the very popular SWFUpload
to accomplish the desired effect with Flash.
Haven't used it personally, but Ajax Uploader is a component I recently came across which says it can do file uploads inside an UpdatePanel (assuming you're using ASP.NET).
Here's a bit of detail about how gmail does it, using an iframe:
i use swfupload for multiple ajax-like uploads (its javascript/flash based)
Strictly speaking there are possibilities to do real AJAX file uploads, but this is only possible in Firefox 3+, Safari 4 and Chrome 2. In all other browsers you must use a workaround like the iframe technique or a Flash based uploader.
Assuming you are using Java, DWR version 3.0 (currently in RC1) has support for binary file upload/download, which makes the problem trivially easy. I have not had a chance to try this out yet but we use DWR extensively with total success; it is a great Ajax toolkit.
http://directwebremoting.org/blog/joe/2008/12/16/dwr_version_3_0_release_candidate_1.html