how i can make ajax uploader for images?
I need to implement Ajax uploader for image on my website. means when someone upload image i show them without refresh.
don't thing it's impossible like most of blog have a process that when upload a image they open pop-up and when i upload pop-up are closed and image now can seen in old windows i have where i write weblog.
can someone show me example or source code to i开发者_StackOverflow中文版mplement this
you might want to check out:
http://pixeline.be/experiments/jqUploader/test.php
and
http://www.malsup.com/jquery/form/#code-samples
They are pretty neat :) Hope it helps! Cheers!
Most common solution for 'ajax' uploads is actually very simple, namely a hidden iframe. As long as it's within the same domain, you can access the contents and parse the response from it just like you would any other request.
The new XMLHttpRequest, most commonly used within HTML5 applications, is actually capable of transmitting files as well. Right now it's not the most broadly supported method, but depending on your situation it might work as well.
- http://www.matlus.com/html5-file-upload-with-progress/
As far as I know.. you can't. This requires a multipart/form-data post and you may only do that with a form. You cannot transmit files asynchronously.
Ajax is an XmlHttpRequest, which does not contain files.
精彩评论