My client offers the user to select an image, crop and resize it, and then display it (in the <img>DOM element ).
If the image is in order, the user can upload it to the server so that it can be saved.
I want to do a download thanks to an Ajax request.
I found a ton of examples on the Internet to download the original image obtained from the client PC. For example:
$( '#my-form' )
.submit( function( e ) {
$.ajax( {
url: 'http://host.com/action/',
type: 'POST',
data: new FormData( this ),
processData: false,
contentType: false
} );
e.preventDefault();
} );
This works correctly if I decide to upload an image obtained through form input.
( <img>) .
base64 ( : croppie.js ).
, Ajax.
, img - :
var url = 'http://host.com/action/';
var data = {};
data.img = $('img#generated-image').attr('src');
$.ajax({url: url, type: "POST", data: data})
.done(function(e){
});
, "img". , , ...
, , base64 , Ajax , .
.
, xmlHTTP POST. , .
EDIT2
post_max_size 8M php.ini, 24K. .
PHP Symfony2.
, Symfony2.