hamed hossani
hamed hossani

Reputation: 1002

how to send image base64 to server

I used base64 encoded to display image dynamically (by select image).

<img style="width: 412px;" src="data:image/gif;base64,R0lGODlhwAAAAXAAACH5BAEAAPwALA

How to send image to a server? by $.ajax() and without postback.

Thanks in advance

Upvotes: 1

Views: 3401

Answers (1)

adeneo
adeneo

Reputation: 318162

$.ajax({
    type: 'POST', //or get
    url : 'urlToMyServer.aspx',
    data: { img : $('img').attr('src') }
});

If the B64 is'nt really, really long, just send it the regular way ?

Upvotes: 2

Related Questions