Support Tickets - CMS 2.1 - plugin Download (links to directly download)

CMS 2.1 - plugin Download (links to directly download)

CMS 18.04.2016 2670 Support Status: Closed Solution: Yes bluesatkv


Hi Jerome,

Question. I have table with all files. File 'download.php'.

I would create a direct link to download the file ( in the right side 'download file').

Now we have links to other page 'downloadfile.php'.

I tested, but not works (code is from 'downloadfile.php'):

<a href="<?php echo $DL_LINK;?>"><?php echo $tld["dload"]["d2"];?></a>

Thanks


Replies (5)

  • avatar Jerome

    Thank you for opening a support ticket.

    A direct download link would look like this:

    html_entity_decode(JAK_rewrite::jakParseurl(JAK_PLUGIN_VAR_DOWNLOAD, 'dl', 'the_id', '', ''))

    That would be the correct way.

    18.04.2016 0
  • avatar bluesatkv

    I understand.

    I use in 'download.php' but not works.

    <a href="<?php echo html_entity_decode(JAK_rewrite::jakParseurl(JAK_PLUGIN_VAR_DOWNLOAD, 'dl', $v["id"], '', ''));?>"><?php echo $tld["dload"]["d2"];?></a>

    links is same as has button in 'downloadfile.php' but not works.

    18.04.2016 0
  • avatar Jerome

    You can't use use it somehwere else then the download page (security wise and for hot linking).

    So it means people can't just link to the file (hotlink preventaion).

    If you wan't to make this work you need to make more custom modifications. The only help I can give you here is to have a look into the download.php file from line 481.

    18.04.2016 0
  • avatar bluesatkv

    It occurred to me another solution :-)

    'download.php' with table

        <table class="table table-striped table-hover table-lastborder results">
            <thead>
                <tr class="warning no-result">
              <td colspan="4">Nenalezen žádný výsledek</td>
            </tr>
            </thead>
            <tbody>
    <?php if (isset($JAK_DOWNLOAD_ALL) && is_array($JAK_DOWNLOAD_ALL)) foreach($JAK_DOWNLOAD_ALL as $v) { ?>
                <tr>
                    <td style="vertical-align: middle;">
                        <span><?php echo jak_cut_text($v["title"],100,"");?></span>
                    </td>
                    <td style="width: 35%; vertical-align: middle; text-align: right;">
                        <a href="<?php echo $v["parseurl"];?>"><?php echo $tld["dload_cmod"]["d"];?></a>
                        <?php if (JAK_ASACCESS) { ?>
                    
                            <a href="<?php echo BASE_URL;?>admin/index.php?p=download&amp;sp=edit&amp;id=<?php echo $v["id"];?>" title="<?php echo $tl["general"]["g"];?>" class="btn btn-default btn-sm jaktip"><i class="fa fa-pencil"></i></a>
                            
                            <a class="btn btn-default btn-sm jaktip quickedit" href="<?php echo BASE_URL;?>admin/index.php?p=download&amp;sp=quickedit&amp;id=<?php echo $v["id"];?>" title="<?php echo $tl["general"]["g176"];?>"><i class="fa fa-edit"></i></a>
                        
                        <?php } ?>
                    </td>
                </tr>
    <?php } ?>
            </tbody>
        </table>

    in row is only name of file without anchor and links to 'Show File'

    <a href="<?php echo $v["parseurl"];?>"><?php echo $tld["dload_cmod"]["d"];?></a>

    in lang folder of download plugin I created new text

    [dload_cmod]
    d = "Show File"

    And works perfect.

    Test link for download link removed

    Many thanks for you, I love your work :-)

    18.04.2016 0
  • avatar Jerome

    Glad you found a solution for your problem.

    *** Ticket closed ***

    18.04.2016 0