Good evening.
I'm trying to create a custom script with osTicket 1.17.2, to manually insert files on the Database (like attachments).
This is the script:
`
require_once('main.inc.php');
require_once(INCLUDE_DIR.'class.http.php');
require_once(INCLUDE_DIR.'class.api.php');
$data = array(
"attachments" => array(
array(
"name" => "myimage.jpg",
"encoding" => "base64",
"type" => "image/jpeg",
"size" => 32768,
"data" => "myBase64hash"
)
)
);
$a = new TicketApiController();
$a->validate2($data);
`
The "validate2" method is the same of "validate", without structure validation control.
The script seems to work, it's create the raw into "file" table but on the "file_chunk" upload only a partial data.
Is there a way to complete/create a script for manually insert file?
Thanks, best regards.
Fabrizio