• Resolved gunther12

    (@gunther12)


    I have some Downloads in Download Monitor, which receive new versions, whenever I release a new version of my Software.

    If have the whole build process automated including the upload of the file to the ftp server.

    The only manual thing I need to do every time, is to go to the Download Moniitor Backend, open the Download, create a new version, navigate to the correct folder on the server, select the new version of the file and update the download. Then I need to do this for the next download and so on.

    This is a tedious and time consuming process.

    If Download Monitor would offer a Rest API Endpoint, I could automate this whole process.

    I already tried some things, but nothing worked.

    For example I tried to create a new Post in WordPress via REST and give it the post type “dlm_download”.

    DOWNLOAD_ID=62092

    curl -X POST “$SITE_URL/wp-json/wp/v2/posts” -d “title=$TITLE&content=$CONTENT&post_type=dlm_download&meta[download_id]=$DOWNLOAD_ID&meta[file_path]=$FILE_PATH” -H “Authorization: Bearer $TOKEN”

    $DOWNLOAD_ID is the ID of the current download, I was hoping that this would link the new file as new version to the download.

    $FILE_PATH is the path of the new file on the server.

    Unfortunately this creates a post, no download.

    Maybe you could point me in the right direction on how to add a new version to an existing download from a shell script.

    Thank you very much!

Viewing 2 replies - 16 through 17 (of 17 total)
  • Thread Starter gunther12

    (@gunther12)

    What a strange concept! This would require me to renumber all existing versions, when I add a a new version, to have this being the topmost, active version, would it?!
    Or could I use (post_id)*-1 as menu order to have the download versions sorted descending automatically?

    • This reply was modified 1 year, 10 months ago by gunther12.
    • This reply was modified 1 year, 10 months ago by gunther12.

    Hey Gunther,

    Yes, you could use the post_id as it is auto incremented, so newer versions will have a higher post_id.

    Warmly,
    Razvan

Viewing 2 replies - 16 through 17 (of 17 total)
  • The topic ‘Batch Create Downloads from Script’ is closed to new replies.