问题
How can I send an image on my server using AJAX to a remote PHP server which is also mine? I don't know how to send and how to save using PHP. I tried to put the image in an iframe and send its content using AJAX like below but nothing happened as you might guess... It returns a message that show it is receiving some stuff and creates a very small broken image.
...
var url = "www.xyz.com/AJAX.php?content=" + document.getElementById('iframe').contentWindow.document;
...
回答1:
here is a good example you could use Ajax Image Uploading
回答2:
Have you had a look at jQuery yet? Its really easy doing ajax calls with it.
For your Image Uploading you might wanna have a look at jquery Forms, it has some sample codes in it here : http://www.malsup.com/jquery/form/#getting-started
来源:https://stackoverflow.com/questions/9479805/how-to-upload-image-using-ajax