Hi Kevin,
The attachments being saved file to OSTicket are being attached as file format only. Im sure Im still missing on something.
$attachments = $request->file('inquiry_attachment');
$attachmentData = [];
foreach ($attachments as $attachment) {
$path = $attachment->store('inquiry_attachments', 'public');
$path1 = public_path('/' . $path);
$type = pathinfo($path1, PATHINFO_EXTENSION);
$mime='data:text/plain;';
$imgext=array("jpg","jpeg","gif","png","bmp");
$excelext=array("xlsx","xls");
$pdfext=array("pdf");
$docext=array("doc","docx");
if(in_array($type, $imgext)){
$mime="data:image/".$type.";";
}
if(in_array($type, $pdfext)){
$mime="data:application/".$type.";";
}
if(in_array($type, $excelext)){
if($type=="xlsx")
$mime="application/vnd.openxmlformats-officedocument.spreadsheetml.sheet;";
else
$mime="application/msword;";
}
if(in_array($type, $docext)){
if($type=="docx")
$mime="application/vnd.openxmlformats-officedocument.wordprocessingml.document;";
else
$mime="application/msword;";
}
$attachmentData[] = [
'name' => $attachment->getClientOriginalName(),
'data' => $path1,
'type' => $mime,
'encoding' => 'base64',
];
} [upl-image-preview url=https://forum.osticket.com/assets/files/2023-10-10/1696910150-840253-sample-capture.png]
Thank you for the help.