nfourtythree/SecureAssetDownload

ZIP files

Closed this issue · 5 comments

Great plugin, is there any easy way of showing the original file names rather than the long string at all? I don't want users to have to add .zip to the end of the file downloads after they have received them.

Hi @JamesNock

I couldn't seem to replicate the outcome you mentioned. All the files I tried downloaded with the filename and extension associated to the asset.

Are there any further details that you could share with me that may shed some light on what is happening. e.g. browser, template code, asset source etc

Thanks!

Hmmmm, that's interesting. I'm using Firefox, uploading 3 zip files of various sizes and my template code to produce links to the files looks like this:

{% 
    set options = {
        asset: 1019,
        userId: [ 1 ],
        forceDownload: false
    } 
%}
{% set url = craft.secureAssetDownload.getUrl(options) %}
<a href="{{ url }}">Download Zip 1</a><br><br>

{% 
    set options = {
        asset: 1020,
        userId: [ 1 ],
        forceDownload: false
    } 
%}
{% set url = craft.secureAssetDownload.getUrl(options) %}
<a href="{{ url }}">Download Zip 2</a><br><br>

{% 
    set options = {
        asset: 1021,
        userId: [ 1 ],
        forceDownload: false
    } 
%}
{% set url = craft.secureAssetDownload.getUrl(options) %}
<a href="{{ url }}">Download Zip 3</a><br><br>

@JamesNock what happens when you change forceDownload to true?

FIXED! Nailed it! Thank you very much! 🥇

Glad it works! 👍