SimpleDesk

SimpleDesk! => SimpleDesk Support => Topic started by: rulrul on September 09, 2015, 05:26:56 AM

Title: Directly paste images into ticket
Post by: rulrul on September 09, 2015, 05:26:56 AM
Hi all

I'm trying to include a "paste image from clipboard" system. I almost have it working . I can paste an image and it uploads a file via ajax to a temporary folder. The most dificult part is how to tell SD about the file and attach it to the ticket on post.

Can anyone help me with that? I've been looking inside simpledesk-Post.php and I saw a place where SD checks whether there's an already uploaded file but I have not been able to know if the file has to have a certain name or whether putting the file info into session is not enough.

I'll share as soon as I have it fully working :)

Thanks

Title: Re: Directly paste images into ticket
Post by: SleePy on September 19, 2015, 03:45:31 PM
Your looking for the shd_handle_attachments() function in that file.  SimpleDesk ties into SMF's attachment system (createAttachment in Subs-Post.php from SMF) and then uses its own table to maintain the relationship between the attachments table, its location and the ticket.  It doesn't use it own storage folders, but rather what was setup for SMF for its attachment location(s).