How to get attached file in wordpress from custom post

Using the Download monitor Plugin, you can not access the File directly via URL, as the plugin restricts the access to the download monitor Folder.

You can generate the downloadlinks quite easily, and still use the plugins counter and other methods.

If you pass the ID of the download as a $_GET-variable to your WordPress installation, the plugin will handle the rest itself:

$downurl = get_bloginfo( 'url' )  . '?download=' . $download->ID;

Resulting in a link like http://example.com?download=1234.

The reason you could not get the download URL by using wp_get_attached_url() is that the dlm_download that you loop through is just a Custom Post Type, and not an attachment by itself. The attachment is connected to the downloadCPT by the post_parent. This way the plugin knows, which download to deliver with which request.

Your code could look something like that:

$args = array(
    'post_type' => 'dlm_download',
    'posts_per_page' => 25,
    'numberposts' => null,
    'dlm_download_category' => $term->slug
);

$downloads = get_posts($args);

foreach ($downloads as $download) {

    echo '<div class="download-content">';

        echo '<h3>
            <a href="' . get_bloginfo( 'url' )  . '?download=' . $download->ID . '" title="Letöltés">
                <i class="left icon-arrow-down"></i>
                '.$download->post_title.'
            </a>
            <a href="' . get_bloginfo( 'url' )  . '?download=' . $download->ID . '" title="Információ">
                <i class="right icon-plus"></i>
            </a>
        </h3>'; 

        echo '<p>'.$download->post_excerpt.'</p>';

    echo '</div>';
}

However, you could also use the Plugin’s built in methods to achieve quite the same thing.