Osticket: How to upload attachments to Folder?

Created on 6 Sep 2014  路  16Comments  路  Source: osTicket/osTicket

How to upload attachments to Folder instead of Database?

And attachments in Ticket Thread should open in new tab or windows in Staff Control Panel and user interface.

I hope Because of Upload in MySQL is hurting server more work load.

cause unknown

Most helpful comment

Hmm. I'm getting "IOException: Unable to read resource content" errors when I try that. It works if I run the CLI command " sudo -u www-data php setup/cli/manage.php file migrate --backend D --to F" (yes, it's Ubuntu). Weird.

All 16 comments

You could do this with the official storage-fs plugin. The download location is here ("Plugins" tab): http://osticket.com/download

1) Load it, place the phar-file in the /include/plugins folder

2) Go to ->Manage->Plugins and choose "Add New Plugin":
add

3) Click on "Install":
install

4) Now you must enable the plugin. Check the box and click on "Enable":
enable

5) Then you must create a directory for the files. In this example I have created the folder "attachments" in the root directory of osticket.

6) You can configure the path when you click on the name of the plugin:

configure

7) Enter the path of the directory and click on "Save changes":

attachments

8) Finally you can switch via the drop down menu from "in the database" to "filesystem: attachments" ( you find it here ->Settings->Tickets->Store Attachments), again click on "Save changes":

store attachments

Now osticket stores your attachments in the configured folder :-)

Hmm. I'm getting "IOException: Unable to read resource content" errors when I try that. It works if I run the CLI command " sudo -u www-data php setup/cli/manage.php file migrate --backend D --to F" (yes, it's Ubuntu). Weird.

Still getting the same errors. The files are stored in a sub of the osticket directory, permissions are 775 for the web server, but still no go. I even moved the directory elsewhere, but had the same problem. It would be less annoying if I wasn't getting e-mails all the time telling me that the server had failed to confirm that the file was where it had just put it.

Hmm. For some reason it's now working, but I haven't done anything but change the permissions to the directory to "777", which implies that the process saving the file isn't owned by the web server, as it has owner and group RWX permissions to that folder already. V. strange.

@simonnzg Easily enough, you can inspect the owner of the files created in the folder, and that should be the user that PHP is running as. It's not too uncommon to run PHP out of process from the web server. For instance, php-fpm does this and provides a number of advantages for hosting environments.
Once you identify the user, you could change the ownership of the attachments folder to be the user that PHP is running as, and then change the permissions back to 751 or something.

Done. All working. Never thought of that. Blinded by the "www-data"... ;-)

This isnt working for us with the storage-fs plugin

Running 1.9.4 (not sure how this works as the latest version seems to be 1.9.14)

The only console message we get when dropping a file is

webkitURL' is deprecated. Please use 'URL' instead.

On clicking the attachment in the ticket we get a 404 page with the following

_The requested URL /attachment.php was not found on this server._

Like simonnzg, the folders seem to be created but nothing inside, tried both 755 and 777 permissions

1.9.4 is ancient. please upgrade to current and test again.

We are having issues with the storage-fs.phar. I uploaded to the include/plugin folder, but is not showing in the GUI. I chack using phpinfo to make sure phar extension is enable. Also change the permissions of the folder from 0755 to 0777, but no luck at all. We are using the latest version 1.9.14 and PHP 5.5. I also try with PHP 5.6 but same results.

Any help will be highly appreciated!

@JLCarbwood
This appears to be a question better suited for the support forums at http:/osticket.com/forum
After you uploaded the code into the folder, did you go to Admin panel -> Manage -> Plugins -> and click Add New Plugin?

@ntozier

Thank you for your quick reply. I will open a ticket there as well. I uploaded using FTP and check the permissions, In the osTicket interface it doesn't detect any file there. i upload other plugins to verify, but it doesn't see anything at all. Very strange in my opinion is like phar is not installed. But when I do phpinfo it shows.

Works like a charm, my question is the files are "hidden" so if need to backup how can i do that?

well 6 months later, news?

@nelsondcosta23

What do you mean by "hidden"?

Cheers.

The files are on the server "upload" folder but when I connect through FTP the folders are empty.
Well I found out the script create with 305 permissions, I changed with ssh access to 775 and done, I can see and backup.
Problem is, if I change the permissions I can't upload future files.

But I'm ok, just want to know where they are.

So, the adice I give is...
You can trust the system, but when you need to empty your server or migrate to other machine you will have a pain in the ass XD but is worthy

Was this page helpful?
0 / 5 - 0 ratings