0

I have installed OSTicket v1.9.12 two-three years back. It is working fine except image attachments. Initially attachments were saved in MySQL but as tickets started growing, the system became bit slow and I configured and enabled "Attachments on the filesystem" plugin.

It was working fine until few days back. But suddenly attachments stopped showing correctly and I started digging the issue and found that images were getting stored correctly on the OSTicket filesystem (Windows).

But when somebody tries to see attachment in browser it is throwing an error "cannot be displayed because it contains errors". Then I downloaded one such problematic image attachment and opened it text editor. I observed that there is LF (Line Feed) character at the beginning of every image attachment such as jpg, png or gif.

If I remove this LF from downloaded file the image look good again.

Does anybody came across with such problem in OSTicket or any other system? Does anybody have any solution for this issue? Thank you.

enter image description here enter image description here

1 Answer 1

0

What a great analysis.

I do not know if you 've been able to shoot your issue, but I had the same problem and thanks to you i got around with the hack below.

In include/class.file.php, locate sendData function, add ob_clean(); between line 118 and 119.

now you shoud have :

  • Line 118 : try {
  • Line 119 : ob_clean();
  • Line 120 : $bk->passthru();

Your image files now display correctly.

1
  • Apologies, My problem resolved. The issue was php closing tag. Someone included a php script in which php tag was closed instead of leaving it open. I just remove the closing tag ` ?> ' and it started working correctly.
    – Silkograph
    Commented Apr 30, 2020 at 5:11

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .