Directly paste images into ticket

Started by rulrul, September 09, 2015, 05:26:56 AM

Previous topic - Next topic

rulrul

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


SleePy

#1
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).
Jeremy D — Spare-Developer