Return two attached files in actionDoUpload()


Well-known member
I'm creating an addon that extends the XenForo_ControllerPublic_Attachment controller. Here's how it works:

When a vector file type is uploaded to a post, I let XenForo to upload it normally and afterwards, I take the uploaded file, pass it through a function that creates a raster preview of the vector image and converts it to a png file and then proceed to insert the generated png file into the attachment system.

It works great and both files are attached successfully to the post. My problem is that I want to display both files, the vector and the png file, when the user is using the attachment editor (creating a thread, a post or a conversation) but I can't seem to find a way to do it. The Javascript libraries in charge of receiving the response from the server seems to only accept one response at a time.

Any idea how to do it without modifying the javascript code?
Last edited: