Hi, just updated from version 1.9.4 to 1.9.5.1Every time I am trying to open an attachment, it just ends up showing a "blank" page. Nothing on it.Here is my System Info:Server Information

osTicket Version

v1.9.5.1 (1faad22)

Web Server Software

Apache/2.2.22 (Debian)

MySQL Version

5.5.38

PHP Version

5.5.20-1~dotdeb.1

PHP Extensions

gdlib

Used for image manipulation and PDF printing

imap

Used for email fetching

xml

XML API

xml-dom

Used for HTML email processing

json

Improves performance creating and processing JSON

mbstring

Highly recommended for non western european language content

phar

Highly recommended for plugins and language packs

fileinfo

Used to detect file types for uploads

PHP Settings

cgi.fix_pathinfo

"1" is recommended if AJAX is not working

date.timezone

Europe/Berlin

Database Information and Usage

Schema

ticketsystem (localhost)

Schema Signature

b26f29a6bb5dbb3510b057632182d138

Space Used

5144.07 MiB

Space for Attachments

4514.20 MiBEverything else is working fine.Any idea what could be the reason???

What i figured out is, that the problem comes from the "class.thread.php" file.I copyed this part from version 1.9.4 and now it works again:    function getAttachments() {        if($this->attachments)            return $this->attachments;        //XXX: inner join the file table instead?        $sql='SELECT a.attach_id, f.id as file_id, f.size, lower(f.`key`) as file_hash, f.name, a.inline '            .' FROM '.FILE_TABLE.' f '            .' INNER JOIN '.TICKET_ATTACHMENT_TABLE.' a ON(f.id=a.file_id) '            .' WHERE a.ticket_id='.db_input($this->getTicketId())            .' AND a.ref_id='.db_input($this->getId());        $this->attachments = array();        if(($res=db_query($sql)) && db_num_rows($res)) {            while($rec=db_fetch_array($res))                $this->attachments = $rec;        }        return $this->attachments;    }    function getAttachmentUrls($script='image.php') {        $json = array();        foreach ($this->getAttachments() as $att) {            $json[$att = array(                'download_url' => sprintf('attachment.php?id=%d&h=%s', $att,                    strtolower(md5($att.session_id().$att))),                'filename' => $att,            );        }        return $json;    }    function getAttachmentsLinks($file='attachment.php', $target='', $separator=' ') {        $str='';        foreach($this->getAttachments() as $attachment ) {            if ($attachment)                continue;            /* The hash can be changed  but must match validation in @[deleted] */            $hash=md5($attachment.session_id().$attachment);            $size = '';            if($attachment)                $size=sprintf('<em>(%s)</em>', Format:($attachment));            $str.=sprintf('<a class="Icon file no-pjax" href="%s?id=%d&h=%s" target="_blank" target="%s">%s</a>%s&nbsp;%s',                    $file, $attachment, $hash, $target, Format:($attachment), $size, $separator);        }        return $str;Any idea why it doesnt work with the code in version 1.9.5.1???

Are you sure that you are running 1.9.5.1?https://github.com/osTicket/osTicket-1.8/releases/tag/v1.9.5.1Because that sounds a lot like the first two things mentioned on this list:Fix file.php to serve files added to system before osTicket v1.9.1Fix file.php to serve files if client panel or system is offlineFix popover download of inline imagesAvoid de-duplicating zero-length filesSend new message alert to team members if not assigned to an agentFix import of users to organization not setting the organizationFix redactor toolbar showing over the date picker (#1450, thanks @[deleted])

Yes, I downloaded the version 1.9.5.1 from your website... it also shows in the OS Ticket that this version is installed. All files in the upload folder where uploaded to the server.Could it have to do anything with the database?In 1.9.4 everything was running without any problems. From 1.9.4 i upgraded directly to 1.9.5.1I dont think it is necessary to first upgrade to 1.9.5 ? Because according to my understanding the database in this case is not touched... only the files...?

I'd check the PHP error log, or enable error display. And see if there are any errors.Here are some instructions on how to turn on Error display if you want to do that.Q: How do I turn on error displaying for osTicket?http://tmib.net/osticket-v19x-frequently-asked-questions-faq#2

Additionally it should be mentioned that only the files changed form 1.9.4 to 1.9.5.1 - so no database upgrade.

10 days later

I am also having the same issue.  Unable to view pdf files in vs 1.9.5.1 that I was just a couple of days before able to view in 1.9.4.I just re-downloaded 1.9.5.1 to make sure I indeed have the latest version and the issue persists.  I tried solution recommended by AR84  above, but that did not work for me.

Write a Reply...