Hello,

We are facing an issue with our Canned responses and more specifically the attachments that are included there. The images have an expiration date of 24 hours, after which the attachments are not avaliable anymore and the images appear broken.

The mentioned 'expiration' can be seen in the following:

<img src="/file.php?key=vttbypwbpu_sfynw8chepro3qormrakw&expires=1544227200&signature=de115a6fed3b83467255ce121ba0a167d9a3599d&disposition=inline" data-cid="vttbypwbpu_sfynw8chepro3qormrakw" width="779" height="977" alt="image" "="">

Is this a setting that we could possibly change?

Details about our installation:

Are you storing images in the database or using the filesystem plugin or using the aws plugin, etc?

Side note: there is no image expiration in osTicket. We've been using the images in some of our canned responses and faq for over 6 years.

Yes, we have installed the plugin to store the attachments in the filesystem. However, before this installation, when attachments were saved on the database, we had the same issue.

6 days later

@stavriani_esp

I just took a quick glance at the code and from what I can tell, we generate the URL (with new expiration) upon loading the Canned Response in the text-area, every time we load the Ticket Thread, when we load a Draft, and when you Edit the Canned Response.

The only way the image will disappear/break is if you use an old, direct link that has already expired.

Load Canned In Textarea:
(This is a trail of the functions that are called)
https://github.com/osTicket/osTicket/blob/develop/scp/ajax.php#L154
https://github.com/osTicket/osTicket/blob/develop/include/ajax.tickets.php#L357
https://github.com/osTicket/osTicket/blob/develop/include/class.format.php#L471
https://github.com/osTicket/osTicket/blob/develop/include/class.file.php#L189
https://github.com/osTicket/osTicket/blob/develop/include/class.file.php#L197-L200

Thread Render:
(This is a trail of the functions that are called)
https://github.com/osTicket/osTicket/blob/develop/include/staff/templates/thread-entries.tmpl.php#L75-L88
https://github.com/osTicket/osTicket/blob/develop/include/class.file.php#L189
https://github.com/osTicket/osTicket/blob/develop/include/class.file.php#L197-L200

Draft Load:
(This is a trail of the functions that are called)
https://github.com/osTicket/osTicket/blob/develop/include/staff/ticket-view.inc.php#L658-L659
https://github.com/osTicket/osTicket/blob/develop/include/class.draft.php#L70-L71
https://github.com/osTicket/osTicket/blob/develop/include/class.format.php#L471
https://github.com/osTicket/osTicket/blob/develop/include/class.file.php#L189
https://github.com/osTicket/osTicket/blob/develop/include/class.file.php#L197-L200

Edit Canned:
(This is a trail of the functions that are called)
https://github.com/osTicket/osTicket/blob/develop/include/staff/faq.inc.php#L14
https://github.com/osTicket/osTicket/blob/develop/include/class.format.php#L471
https://github.com/osTicket/osTicket/blob/develop/include/class.file.php#L189
https://github.com/osTicket/osTicket/blob/develop/include/class.file.php#L197-L200

Cheers.

5 months later

Hello,

I'm also having a issue with attachments and links expiring. Is there a way to remove this or increase the expiry? I see in the help bubble the explanation:

From a security perspective, be aware that the user's browser may retain previously-viewed files in its cache. Furthermore, all file links on your helpdesk automatically expire after about 24 hours.

The link to the attachment contains a timestamp:

https://tickets.domain.com/file.php?key=gtjud45fb8yic_ow6t0hfd-07kqtkpce&expires=1558137600&signature=89e812fbc69ac442e46a91a32584814b55adb2a1&id=19764

The attachements are saved to the database. We do have the file storage plugin installed but it's disabled.
Running v1.12 (a076918)
MySQL Version 5.5.60
PHP Version 5.6.40

Thanks

Write a Reply...