Hello,This year I inherited an OSTicket 1.6 environment which I've since upgraded to 1.9.2.  It took a little bit of work (I think the last guy botched an upgrade) but eventually I got it working and it's quite nice.Then this week I started getting reports that attachments weren't working.  I'm not sure that they've ever worked, so I don't know if it's something which used to work and doesn't anymore, or if it's never worked in this environment.The trouble is this:  When creating a new ticket, I can select a file to attach.  It appears with a checkbox next to it.  I can submit my ticket.  But when I go to look at the ticket, from either a staff or client view, I cannot see the attachments at all.  The system knows it must be there, as there's a paperclip icon next to the ticket name in the ticket list, but when viewing the details nothing is there.I tested this with replies as well and it exhibits the same behavior.  Files seem to upload fine, but they are nowhere to be seen when reviewing replies.My first fix was to try changing from saving to the database, to saving to the filesystem.  Although the attachment directory was found, and the .keep file created, no attachments appeared.So I went back to saving to the database, and started poking around.  I can see the files saved in the database tables, so they are being recorded, just not appearing in the list of replies.My next step is to set up a fresh test environment, and see how that behaves, but if anyone has some more educated directions I could take my search in, I'd really appreciate it.Let me know if I need to supply more information, and I will supply it.

"The trouble is this:  When creating a new ticket, I can select a file to attach.  It appears with a checkbox next to it."This is actually an issue currently. Please see https://github.com/osTicket/osTicket-1.8/issues/727#issuecomment-41426801If you want to post to that thread maybe we can get some traction on the issue.

Thanks, I'm off to that thread!

It looks like the thread that's open is a slightly different issue.  I think I've found a solution to mine, as I'll outline here:1. First I installed a fresh 1.9.3 system and checked to make sure attachments worked.  They did.2. Then I compared the database schema of ost_ticket_attachment that I have in production to the schema of a freshly installed 1.9.3 system.  I noticed that they were quite different, namely the Engine type and the collation.  3. Using Toad for MySQL, I ran the compare and got a sql script to update my seemingly outdated table structure to the new 1.9.3 table structure.  Now attachments show up!

I've pointed out this thread to the devs.  I'm not sure why your table would differ from a fresh install, unless the upgrader wasn't run, or maybe someone missed something.

9 days later

Not sure if you guys are still having the issue, but on a fresh install (first-time user), I ran into the same issue.Here's the fix (at least, it worked for me):In /scp/tickets.php, in the stock code, line 494 reads:"if(($ticket=Ticket:($vars, $errors))) {"Before this line, insert the following:if($_FILES)                         $vars = AttachmentFile:($_FILES);The problem was simply that, when opening a ticket, the code was not looking for and processing attachments.

Write a Reply...