Search code examples
jqueryajaxfile-uploadjquery-file-upload

How to upload an image from a URL using AJAX?


I want users to be able to add a photo to a page by giving its URL. I want to both display it and save the image on my server. Can I do this using AJAX, and ideally with Jquery?

I'm currently using the Jquery File Upload plugin to handle uploads from the user's computer, however I could not find a way of using it to handle upload by URL.


Solution

  • If it's just a URL, you can send the URL to the server and make it download the image, instead of sending the whole image in AJAX.