We use cookies to improve your experience. No personal information is gathered and we don't serve ads. Cookies Policy.

ExpressionEngine Logo ExpressionEngine
Features Pricing Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University
Log In or Sign Up
Log In Sign Up
ExpressionEngine Logo
Features Pro new Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University Blog
  • Home
  • Forums

Linklocker Free (encrypt download links)

Development and Programming

John Fuller's avatar
John Fuller
779 posts
17 years ago
John Fuller's avatar John Fuller

I have a feature where I am using an external resource to create a PDF.

This is kind of funky.

Click on PDF link -> sends info via segments to another EE template which creates output to be placed in the PDF -> calls outside resource to create the PDF based on the source from the template (curl.)

We would like to keep these URL’s hidden so that…

  1. People don’t know where the PDF server is located so they can just go to town creating PDF’s (I know I could do this on the PDF server side with firewalls and other tricks but I don’t want to mess with that right this moment.)

  2. We would like to minimize the possibility of link sharing by having the URL’s expire.

Nothing is critical. Security by obscurity is fine here. I just want some very basic controls.

       
Mark Bowen's avatar
Mark Bowen
12,637 posts
17 years ago
Mark Bowen's avatar Mark Bowen

Ah right I see now. Protecting resources is definitely a good idea there!

Thanks for the explanation. Hope you get it all sorted. I’m sure if Brad can add that in for you then you will be set 😉

Best wishes,

Mark

       
Brad Street's avatar
Brad Street
239 posts
17 years ago
Brad Street's avatar Brad Street

John,

I’ve updated the module to accept an aditional parameter through the exp:linklocker tag. If you set the url to the page that you want to hide, and add the parameter mode=”page” to the tag, it should do the trick. Let me know how it works out for you!

       
John Fuller's avatar
John Fuller
779 posts
17 years ago
John Fuller's avatar John Fuller

Sweet, did you update the download link?

       
Mark Bowen's avatar
Mark Bowen
12,637 posts
17 years ago
Mark Bowen's avatar Mark Bowen

EDIT - Works great Brad, well done!! 😉 Now that’s what I call fast service 😉

Excellent Brad!! 😊

I can see how this could be very handy now!

Best wishes,

Mark

       
Brad Street's avatar
Brad Street
239 posts
17 years ago
Brad Street's avatar Brad Street

Thanks, Mark. John - yes, the link at the start of this thread has been updated to v1.2 of the script. Enjoy!

       
Brad Street's avatar
Brad Street
239 posts
17 years ago
Brad Street's avatar Brad Street

John - just wanted to offer another thank you for your generosity. Didn’t write this script to make money, but a donation here and there sure does encourage development 😉

       
stefanschuur's avatar
stefanschuur
21 posts
17 years ago
stefanschuur's avatar stefanschuur

Thanks Brad! Just what I needed.

       
Yuri Tomanek's avatar
Yuri Tomanek
3 posts
17 years ago
Yuri Tomanek's avatar Yuri Tomanek

Hi Brad

Thank you so much for the module. Exactly what i’ve been looking for.

I am having a slight issue with it though. The module will work perfectly if i use a full domain

ie - http://something.com.au/directory/file.zip

If i try to use a custom field storing the url it fails I get an error “Requested file does not exist”

This is the code i am using

{exp:weblog:entries weblog="store"}
     {exp:scm_entry_access entry_id="{entry_id}"} 
          <a href="http://{exp:linklocker">Download</a>
     {/exp:scm_entry_access}
{/exp:weblog:entries}

If i remove “{download_url}” and replace it will the full url to the file it works. I have tested the custom field without using the linklocker module at it works.

Any ideas?

       
Mark Bowen's avatar
Mark Bowen
12,637 posts
17 years ago
Mark Bowen's avatar Mark Bowen

Hope you don’t mind me coming in on this one Brad but Yuri what exactly do you have stored in the {download_url} variable. If you are only storing the name of the file (plus its extension of course) then LinkLocker is in fact showing the correct response as it would have no way of knowing where the file is located rather just what the file is called. You would need to then hard-code back in the path to that file in front of your {download_url} variable.

Don’t know if that helps at all.

Best wishes,

Mark

       
Yuri Tomanek's avatar
Yuri Tomanek
3 posts
17 years ago
Yuri Tomanek's avatar Yuri Tomanek

Hi Mark.

Thanks for your reply. Currently i have the full url in the {downloads_url} variable. I will try just using the filename and hard coding the rest of the url before the {download_url} a go.

Thanks

       
Mark Bowen's avatar
Mark Bowen
12,637 posts
17 years ago
Mark Bowen's avatar Mark Bowen

Hi Yuri,

Also something to try if that doesn’t work is to just code the link like this :

Here’s the link

without using the http and domain part. I think (could be wrong though) that Brad updated the module to work with paths instead of domains so that might be worth having a try with also if the full domain doesn’t work. Also don’t forget about the {site_url} variable that will fill in the first part of your domain for you.

Hope that helps.

Best wishes,

Mark

       
Brad Street's avatar
Brad Street
239 posts
17 years ago
Brad Street's avatar Brad Street

Thanks for the assist, Mark. Almost 100% correct - but I did not update this module to require path only (that was the List Contents plugin).

@Yuri, My only guess would be to make sure that the field storing the url is Text Only, and not XHTML, as it could be adding tags to the URL. Otherwise, I can’t imagine why it may not work for you if you have the full URL to the file. You could try calling the {url} before the link just to make sure it contains the value you expect it to.

Am performing today and tonight, but will try to look at this tomorrow if it is still a problem. Let me know what you find out.

Thanks, Brad

       
Mark Bowen's avatar
Mark Bowen
12,637 posts
17 years ago
Mark Bowen's avatar Mark Bowen
Thanks for the assist, Mark. Almost 100% correct - but I did not update this module to require path only (that was the List Contents plugin).

Oops very good point! It was the List Contents plugin wasn’t it!! 😉 Sorry!!

@Yuri, My only guess would be to make sure that the field storing the url is Text Only, and not XHTML, as it could be adding tags to the URL. Otherwise, I can’t imagine why it may not work for you if you have the full URL to the file. You could try calling the {url} before the link just to make sure it contains the value you expect it to.

Very good point and would have been my next port of call had I not mixed up your two plugins like that!! 😉

Am performing today and tonight, but will try to look at this tomorrow if it is still a problem. Let me know what you find out. Thanks, Brad

What performing is that then Brad?

Best wishes,

Mark

       
Brad Street's avatar
Brad Street
239 posts
17 years ago
Brad Street's avatar Brad Street

Hey Mark, When not building cool modules like this for EE, or programming at work, I play guitar & sing, both solo & in a band. My website is at http://www.bradstreetband.com. Performed solo at a festival this afternoon, and am playing a local bar tonight.

       
1 2 3 4 Last

Reply

Sign In To Reply

ExpressionEngine Home Features Pro Contact Version Support
Learn Docs University Forums
Resources Support Add-Ons Partners Blog
Privacy Terms Trademark Use License

Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.