I've no clue how impresspages uploads images. I've tried many of the function but did not succeeded yet.
$("#choose_image").on('change',function(e){
var data = {
'aa' : 'InlineManagement.customImageSave',
'securityToken' : $('input[name=securityToken]').val(),
'image' : JSON.stringify($(this)[0].files)
};
$.ajax({
url : ip.baseUrl,
type : 'POST',
dataType : 'Json',
data : data,
})
.done(function() {
console.log("success");
})
.fail(function() {
console.log("error");
})
.always(function() {
console.log("complete");
});
});
AdminController
public function customImageSave()
{
ipRepositoryAddFile(json_decode($_POST['image']));
return new \Ip\Response\Json(array('Sucess' => 'Image added successfully'));
}
I get the following error when I use ipRepositoryAddFile
Uncaught exception 'Ip\Exception' with message 'File doesn't exist' in
D:\xampp\htdocs\ImpressPages\Ip\Internal\Repository\Model.php:118