Vijay Boyapati
Vijay Boyapati

Reputation: 7728

How to do an ajax post of an image on an HTML page?

I'm using Alex Michael's fantastic javascript filtrr library to allow me to manipulate images on an HTML page. The question I have is how do I do an ajax/jquery post of an image that has been filtered inline on the page? For instance:

<div>
<img id="myimage" />
</div>
<input type="button" onclick="filterImage();" />

Once the filtering has been done, how do I post the contents of the image with id "myimage" back to a server-side PHP script so the filtered image can be saved? The tutorials I've seen for doing ajax image POSTs have all used file uploaders, which isn't what I'm looking for. I want to post an image from the HTML DOM.

Thanks!

Upvotes: 0

Views: 197

Answers (1)

just a slime
just a slime

Reputation: 490

Since the library you are using uses the Canvas element, the solution here should apply: Uploading 'canvas' image data to the server

Upvotes: 3

Related Questions