Reputation: 361
I wanted to know if there is a way to upload image to server from the src
of the img
tag. The src
can be an absolute path or base64 encoded string depending on some conditions.
I tried a sample application using JQuery AJAX and PHP running in wamp server. In that I am creating a form with file upload control. And posting a FormData object of the uploaded image to server. Reference: https://www.simplifiedcoding.net/php-upload-image-tutorial-using-jquery-ajax/
Now I want to upload image from src
instead of the image selected using file upload control.
Upvotes: 4
Views: 4374
Reputation: 971
Yes , You can upload base64 encoded string(src part) to the server and save it as it is or convert it into an image and save it as a file.
Upvotes: 1