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

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

My bad - didn’t notice the link to the Downloads Area. When I click the direct link, I get transferred to your blog - not a download. What does your .htaccess look like? I just checked and it appears that if i go to the zipfiles directory I get your blog as well - perhaps this blog page is the index template for this directory? Either way, it would appear that the problem at this moment is with the .htaccess.

       
mediavilla's avatar
mediavilla
79 posts
17 years ago
mediavilla's avatar mediavilla

Hi Brad,

The value of {cf_ib_zip} is there, where it says “Download Comp1.zip” or “Download zipfile.zip”. Comp1.zip and zipfile.zip are the names of the files.

The field type is text only and there aren’t any spaces in the file name…

When I click on the direct link I get a download, try with the link below (is the same):

http://www.bablingua.com/zipfiles/zipfile.zip

My .htacess:

RewriteEngine on
RewriteCond $1 ^(zipfiles|bablingua|forum|bl_includes|bl_css_js|P[0-9]{2,8}) [NC]
RewriteRule ^(.*)$ /index.php/$1 [L]

Thanks again,

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

Ok, let’s take a different direction. Have you tried an uninstall/reinstall of the LinkLocker module? Also, have you checked the error log on your server?

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

Hiya,

There’s definitely something odd going on there. I just tried logging in and can see the download links but none of them work. Also the direct ZIP download link just takes me to a template instead of downloading a file.

I know it sounds silly but have you double-checked that the file is definitely in there? Also as an aside you don’t have a template group called zipfiles do you?

Best wishes,

Mark

       
mediavilla's avatar
mediavilla
79 posts
17 years ago
mediavilla's avatar mediavilla

Yep, I’ve reinstalled the plugin and I noticed that there was a different linklocker URL, before was www.bablingua.com/?ACT=38&url;=… and after www.bablingua.com/?ACT=39&url;=…

I haven’t checked the Log files… what should I look for?

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

Ok, well I’m about stumped. Let’s try this - can you remove the {cf_ib_zip} from the link and hard code in the path to the linklocker call & see if it works?

       
mediavilla's avatar
mediavilla
79 posts
17 years ago
mediavilla's avatar mediavilla

I’m sorry, I’m stumped as well, I tried to hardcode the link as follows and this is how the code looks:

{if logged_in}
    {exp:weblog:entries weblog="icebreaker" dynamic="off"}
    {exp:scm_entry_access entry_id="{entry_id}"}
    You have already purchased this item - <a href="http://{exp:linklocker">Download {cf_ib_zip}</a>


    hardcoded link 1 - <a href="http://{exp:linklocker">Download {cf_ib_zip}</a>


    hardcoded link 2 - <a href="http://{exp:linklocker">Download {cf_ib_zip}</a>


    {/exp:scm_entry_access}
    {/exp:weblog:entries}
{/if}

Still not working though… now I’m on another computer and you were right, the link is going to the blog page instead of start the download so maybe it’s related to the .htacess file…

       
vinco's avatar
vinco
42 posts
17 years ago
vinco's avatar vinco

Hi Brad,

do you think it’d be easy to implement one more feature (always one more)?

I’m using the Yahoo Media Player for playing mp3 on my website. The player plays the files that have an mp3 extension.

Your module allows to hide the location of the file which is awesome but do you think there’d be an easy to be able to add the mp3 extension after your generated garbage so that the file could be played on the player instead of being downloaded?

I looked at the code but my PHP skills are not good enough, I guess.

Thanks again for your module, it’s awesome the way it is 😊 Vincent

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

Hey Vincent,

I must admit that I’ve never used the Yahoo Media Player, although I am a fan of the YUI. At any rate, after a brief look at their documentation I’ve come up with this: Set the MIME type of the file in the link - such as:

<a href="http://example.com/mysong">a song</a>

Of course, the href would be the link generated by the LinkLocker module. This way, the media player will know that the link is playable. For more info, check out this page in the Media Player Wiki.

Please leave a comment here if this works (I suspect it should) in case others have a similar issue, and thanks for using my module.

Brad

       
vinco's avatar
vinco
42 posts
17 years ago
vinco's avatar vinco

Hi Brad,

Thanks for the quick reply.

Unfortunately this doesn’t work, or at least not the way I expect it.

When I did what you said, the text link works well as expected (ie it opens the download link with the correct file that’s hidden). But when I press the “Play” button next to the text link, this doesn’t launch the player.

I think it’s because the file doesn’t contain the .mp3 extension on the generated file which the Yahoo player needs.

Vincent

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

Vincent,

Tested with .mp3 extension, that isn’t the issue. I tried what I suggested to you and found that while clicking the link did actually link to the download of the .mp3 file, it wouldn’t play in the Yahoo Media Player. I did, however, figure out sort of a compromise. If you will set the files you wish to play up in a playlist (.xspf format), you can use linklocker on the playlist so that the location can’t be found (the playlist location will be encrypted) and therefore links will effectively be encrypted. I was able to verify that this method works - hope you find it useful. More info on using XSPF playlists here.

       
vinco's avatar
vinco
42 posts
17 years ago
vinco's avatar vinco

Hi Brad,

Thanks for taking the time for this.

I’ll try it tomorrow. It’s getting late here 😊

Vincent

       
vinco's avatar
vinco
42 posts
17 years ago
vinco's avatar vinco

OK.

Things have changed but still don’t work!

I can’t use the Yahoo Media Player since they generate <a> tags in addition to the playlist. So basically the playlist is encrypted but you can still get access to the file and download it. Not really useful to protect the file 😊

So I switched to another popular player (http://www.jeroenwijering.com). I tried your script with an encrypted mp3 file as well as a XSPF Playlist.

Unfortunately it still doesn’t recognize it. When it’s not encrypted it works fine though.

I don’t get it why it doesn’t work. Do you have any more ideas?

Thank you so much for your help, you’re so kind…

Vincent

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

Hi Vincent,

Well I’ve spent most of my morning trying to find a way to assist, and I’m afraid I can’t help you with this. For my own site, I’ve customized the XSPF player to play the songs from a playlist and disabled making them downloadable, and of course, hidden the playlist. Just took a bit of Actionscript to make the magic happen - you can see the results at the best band website in the world! The player is usable embedded in the page, or via a popup - text link below the player. You can download the XSPF player here for free, but you’ll need to customize it with a bit of AS for desired results. Best of luck!

       
S. Lee Ware's avatar
S. Lee Ware
39 posts
17 years ago
S. Lee Ware's avatar S. Lee Ware

Brad, this looks like a nice module.

Something that may be a nice feature addition would be if the module checked the file extension (.pdf, .mp3, .jpg, etc.) and ended its created link with the same extension.

Example:

"site.com/files/doc.pdf"

passes through Linklocker and becomes

"1203984713048dsfphewhatever.pdf"

Keeping the extension would be very helpful for certain CSS uses like attribute selectors, so in the above example:

a[href$='.pdf'] { 
    padding: 5px 0 5px 22px;
    background: transparent url(/images/icons/icon_pdf.gif) no-repeat left center;
}

could style the ‘locked’ link.

It seems like this would solve Vincent’s problems too.

Thanks.

       
First 2 3 4 5 6 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.