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.
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,
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
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…
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
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
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
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.
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
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!
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.
Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.