0

How do you make the files of a specific file manager downloadable? For example, lets say you have a file manager which is just for PDFs. What tag do you use for making the PDFs downloadable? I feel like this is basic, but the documentation for EE3 shows nothing of the sort and I'm not sure how to use Google search for something this specific.

See this site for specific details Here

Code for that notes & questions section is as follows, the '???' denote where I have no clue what to put in order to make the PDFs/files downloadable:

<div class="col-sm-4">
    <div class="fancy-title title-double-border">
        <h3>Sermon Notes</h3>
    </div>

    {exp:channel:entries channel="sermon_details" dynamic="no"}
    <a href="???" target="_blank" class="button button-rounded button-reveal">
        <i class="icon-line-paper-stack"></i>
        <span>Part {sermon_part}</span>
    </a>
    {/exp:channel:entries}
</div>


<div class="col-sm-4">
    <div class="fancy-title title-double-border">
        <h3>Study Questions</h3>
    </div>

    {exp:channel:entries channel="sermon_details" dynamic="no"}
    <a href="???" target="_blank" class="button button-rounded button-reveal">
        <i class="icon-line2-pencil"></i>
        <span>Part {sermon_part}</span>
    </a>
    {/exp:channel:entries}
</div>
1

You can use HTML download attribute in the <a> tag.

<a href="{file_field}" download>Filename</a>
0

Handling files is relatively straightforward enough. Use the documentation found here : https://docs.expressionengine.com/latest/fieldtypes/file.html#single-variable-usage

UPDATE:

I checked out your example and it wouldd appear that you have spaces in your link URL - http://www.mannawebsites.com/_development_sites/bestest/images/uploads/sermon_notes_questions%20/ruth_notes_pt1.pdf - note the %20 after questions and before /ruth (it actually appears as a space inthe URL, SE has placed the hex in automatically... remove that space and it works.

I'm unsure why there would be a space but likely due to a space in the destination folder when initially setup.

2
  • I put more in per the listed documentation, but I'm still getting 404 errors when I click on the PDFs. Why? I tried the path tag and the URL tag with the below: {questions} <a href="{path}" target="_blank" class="button button-rounded button-reveal"><i class="icon-line2-pencil"></i><span>Part {sermon_part}</span></a> {/questions} and even simply ` <a href="{notes}" target="_blank" class="button button-rounded button-reveal"><i class="icon-line2-pencil"></i><span>Part {sermon_part}</span></a> Same problem. 404 error. What am I doing wrong?
    – Greg
    Jan 9 '17 at 22:45
  • This is a URL I get with a 404 error: http://www.mannawebsites.com/_development_sites/bestest//images/uploads/sermon_notes_questions%20/ruth_notes_pt1.pdf - what should be the REAL URL ? Jan 10 '17 at 2:27
0

It URL needs to be:

http://www.mannawebsites.com/_development_sites/bestest//images/uploads/sermon_notes_questions/ruth_notes_pt1.pdf

It's showing a %20 (hex 32 code for space) behind every file that referenced from that file manager on the page. It needs to not have the %20 at the end of "sermon_notes_questions". I found out why EE is encoding a space in that URL at the end of the file manager name.

I checked the file manager settings and reviewed the upload directory URL. ::palm plant:: I had a small space within the upload directory URL between sermon_notes_questions and \ and I didn't see it!!!! I removed that space and saved the file manager, again. Done, it fixed. Crazy how this all happened unbeknownst to me.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.