Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

In this Discussion

osTicket v1.10 (stable) and Maintenance Release v1.9.15 are now available! Go get it now

Extract Attachments to folder from Database

Hi ,

I am using OS Ticket for a small internal Helpdesk and have decided recently to use for another function.

  • We need to review certain log files.
  • I am emailing them from servers
  • A ticket is created.
  • We review the log , close the ticket with message reviewed.

However  - I have searched forums and cant seem to find out how we can extract the logs in their current format to a Folder on server. I have a need to call on the files again .

Any ideas apreciated. Will stay searching and post soln here if exists.

Cheers!

Comments

  • Hi ,

    I have figured out. I needed to list the files , then extract the file from "Blob" - I re-used - http://bytes.com/topic/php/insights/740327-uploading-files-into-mysql-database-using-php/4

    The code isnt using any security of the OST system  , but it does what I need at the moment.

    I will post code if any one interested.

    Cheers!
  • Feel free to post the code... you never know when someone else will want to do that exact same thing. :)
  • Code attached. Remember - there is no security on this and no logic to check if chunks are split across different blobs on the mySQL DB.

    Also the List Files contains a where clause that you may need to change.

    Place both files in same folder on your Webserver.

    Cheers!



    download_attach.php.txt
    2K
    list_attach.php.txt
    2K
Sign In or Register to comment.