Reputation: 8091
is there a way to do this? I'm not looking for an alternative plugin (like FancyUpload or Uploadify), I just want to know how I can ajaxify the submission of an upload form.
Upvotes: 0
Views: 733
Reputation: 238727
This is one of the only pure JavaScript solutions available. It takes advantage of newer browser technologies, but also degrades well to work with older browsers (like IE 6) by using the iframe method.
I have used this solution and have been very happy with the results.
Upvotes: 0
Reputation: 26165
i have seen this done with an iframe shin, something like this: http://www.openjs.com/articles/ajax/ajax_file_upload/
although i would not condone the usage of iframes normally :D
Upvotes: 0
Reputation: 32831
Not sure of what you mean by "ajaxify" but as Doug stated, you cannot use an xhr to send the content of a file to the server. If you want to avoid the refresh of the page containing the form, you can use an invisible iframe as the target of the form.
Upvotes: 0
Reputation: 66191
If you aren't wanting to use a plugin that couples Flash with JavaScript to provide upload progress, you can try a few things:
submit
action continue.You simply can't grab the contents of a file selected by a input
element and submit it using XMLHTTPRequest. You need to either do a normal POST
or use Flash.
Upvotes: 1