I want to upload files without using attachments field in osTicket using API. attachments is working very well in both Web source tickets and API source tickets. but if I add another form field named custom-attachments then it's working only in web source tickets but in API source tickets it takes powered-by-osticket.png by default even after I entered correct format of file.
My file field structure is like => array( 'example.png' => 'data:image/png;base64,'. base64_encode(file_get_contents('FILE PATH')));
So if I am doing any mistake or is there any different way to upload other file field using API
My whole code as follows for create tickets using API
$data = array(
'name' => 'name',
'last_name' => 'surname',
'email' => 'firstname.lastname@example.org',
'phone' => '9876543210',
'subject' => 'test',
'message' => 'test for API image Upload',
'ip' => $_SERVER['REMOTE_ADDR'],
'attachments' => array(), //it's working proper
'priority' => ''
'custom_attachments' => array( 'example.png' => 'data:image/png;base64,'.
base64_encode(file_get_contents('FILE PATH'))); // only issue is here
In this code all fields are working perfect excepting custom_attachments. It returns in database no value so it takes automatically id=1 and so in tickets it shows powered-by-osticket.png.
If you have any idea about it please give me suggestion.
Thanks in advance.