I had kendo grid with inline editing. Now I want to add an upload images to 'propertyLogo
' field. Basically, I use an editor function and call saveUrl: "indexHex.php
, and fetch by PHP post method then convert to base64
and store into $imageHex
variable.
In kendo Upload complete
event, I load the php file and pass $imageHex
to textbox. But somehow I get [obeject Object] in the textbox.
Any idea how I can fetch the $imageHex
from indexHex.php
my indexHex.php
if($_SERVER['REQUEST_METHOD']=='POST') {
$file = $_FILES['fileUpload'];
$fileName = $_FILES['fileUpload']['name'];
$fileTmpName = $_FILES['fileUpload']['tmp_name']; //directory location
$fileSize = $_FILES['fileUpload']['size'];
$fileError = $_FILES['fileUpload']['error']; //default 0 | 1 got error
$path = getcwd();
$fileDestination = $path.'/uploads/'.$fileName;
move_uploaded_file($fileTmpName, $fileDestination);
$data = file_get_contents($fileTmpName);
$imageHex = base64_encode($data);
echo $imageHex;
}
This problem a almost similar with my previous question but with different approach.