Support » Plugin: Download Monitor » add file as DLM post programatically

  • Does anyone know the way to properly add a file as a DLM post programatically? Looking through the code I can’t find a straightforward function to call to do this, and I can’t find anything in the docs. I’ve had to do some stuff and I’ve ended up breaking the process down according to what I can see in the data for resources uploaded via admin, i.e. created dlm_download, create dlm_download_version, create attachment post, etc. I’m just wondering if there’s a simpler / official way to do this.

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author Barry Kooij


    Hey Steve,

    I think we already discussed this via email but I’m replying here as well for others that are wondering the same thing 🙂

    Honestly, currently there is not great way to do this. The way to currently do this is to mimic the way the plugin currently does this in it’s own classes. Because there are no API like methods, you’re forced to copy some of the code to your custom code. Improving this will be a large focus for the 4.0 release.

    Kind Regards,

    Barry Kooij

    Thanks. I guess the lack of an API explains why there are so few integrations with other plugins. Honestly I thought that since DLM is such a popular plugin, most related plugins would accommodate it. But I couldn’t find anything that would bring attachments to comments or Gravity Forms uploads into the DLM system.

    We’ve had to write our own plugin to handle this. It’s not been properly tested and I’m not sure if the company I’m working with will publicly release it. I guess it’ll be worth waiting for 4.0 to simplify it in any case. If anyone reading this is stuck with the same issues, they can PM me in the meantime and I’m sure I can help a bit.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘add file as DLM post programatically’ is closed to new replies.