Im sending an image to the server using form data.
//create form data from form
var formData = new FormData($('#my-form')[0]);
//append the image
formData.append('file', myFile);
//add data from crop plugin
formData.append('file-data', cropData);
//POST
$.ajax({
url: /upload,
type: 'POST',
dataType: 'json',
processData: false,
contentType: false,
data: formData
})
My issue occurs when I try and add the data from the crop plug in, it logs ok:
Object {x: 140, y: 273.49999999999994, width: 520, height: 520, rotate: 0}
but once posted in PHP it just dumps as an empty array with no properties.
Where am I going wrong?