I'm trying to upload an image that has been cropped by icrop.js but am not good with JQuery & Ajax.How can I grab the image from the result and send it to a folder on the server?
<form id="form" action="upload.php" method="post"
enctype="multipart/form-data">
<input id="file" type="file" accept="image/*">
<img id="result">
<input type="submit" value="Upload">
</form>
<script>
$(document).ready(function(){
$("#file").change(function(e){
var img = e.target.files[0];
if(!iEdit.open(img, true, function(res){
$("#result").attr("src", res);
})){
alert("Whoops! That is not an image!");
}
});
});
</script>
When the image is cropped its placed in the image tag with id="result". This is what I need sent to the server.