Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to upload image using AJAX

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;
...
like image 703
Mehmed Avatar asked Jan 25 '26 13:01

Mehmed


1 Answers

here is a good example you could use Ajax Image Uploading

like image 162
Duke Programmer Avatar answered Jan 28 '26 03:01

Duke Programmer



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!