1

I've generated a base64 data of an image and fed it into the src attribute of the <img/> tag so now the image appears. But now next task is to upload the image file from the <img/> tag to the server. But since I've the base 64 of the image I don't know how to upload it to the server.

Please guide.

1
  • Couldn't you POST/GET the base64 to the server then convert it there? This might help Commented Jul 5, 2015 at 0:06

2 Answers 2

1

You can send the Base 64 data to the server throw a normal AJAX POST.

Even with jQuery: $.post('/save', {image: base_64_data})

Then in the server, as mentioned on this answer (PHP Example), you can save the image on disk or do whatever you want.

Sign up to request clarification or add additional context in comments.

Comments

0

As mentioned send it across as a base64 and convert it on the server. It's already been coded to a base64, there is no need to convert it to an image, ie bmp, jpeg, etc., and take the performance hit of encoding the immediately decoding to send.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.