Nidhish
Nidhish

Reputation: 361

Upload image from src attribute of img tag JQuery AJAX PHP

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

Answers (1)

Hiren patel
Hiren patel

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.

check this answer

Upvotes: 1

Related Questions