Protected Links
ExpressionEngine 2, ExpressionEngine 3, ExpressionEngine 4, ExpressionEngine 5, ExpressionEngine 6
Back to this add-on's main page
View Other Add-ons From Yuri Salimovskiy
S3 zip and cpgz file
Support Request
drudoran
|
Posted: 08 May 2012 08:57 AM |
|
|
|
|
|
|
Yuri Salimovskiy
|
Posted: 08 May 2012 12:12 PM |
# 1
|
|
Developer
|
So what’s the question? :)
|
|
|
Yuri Salimovskiy
|
Posted: 08 May 2012 12:25 PM |
# 2
|
|
Developer
|
So what’s the question? :)
|
|
|
drudoran
|
Posted: 08 May 2012 12:57 PM |
# 3
|
|
|
Sorry - don’t know what happened there…
I have some zip files on S3. When I download them from a normal <a > link on my site, they download and unzip fine.
When I use the Protected Links, the file downloads ok, but when I unzip them, they contain cpgz files.
Any idea whats happening there?
Andy
|
|
|
Yuri Salimovskiy
|
Posted: 08 May 2012 01:35 PM |
# 4
|
|
Developer
|
My only guess is that it’s something happening on S3 side.., maybe some setting or what
Because Protected Links is simply retrieving the file and passing it to customer, it does not make any changes
|
|
|
drudoran
|
Posted: 08 May 2012 02:28 PM |
# 5
|
|
|
It’s strange - Been using Protected Links for about a year with no problems, then yesterday I upgraded EE to 2.4.0 and also upgraded Protected Links and I just can’t get it working again.
I have taken out the index.php and have the htaccess set up as instructed on Expression Engine, so don’t know if this would cause an issue.
But I’ve just tested a very basic page with this tag:
{exp:protected_links:generate url=“http://www.mydomain.com/files/test.zip” ip_lock=“yes” guest_access=“yes” title=“Get the file!”}
and the file starts to download, but only about 1k. When I open the download in text mate, I can see the following message:
A PHP Error was encountered
Severity: Warning
Message: curl_setopt(): CURLOPT_FOLLOWLOCATION cannot be activated when in safe_mode or an open_basedir is set
Filename: protected_links/mod.protected_links.php
Line Number: 212
Does that suggest anything ?
Regards
Andy
|
|
|
Yuri Salimovskiy
|
Posted: 09 May 2012 12:13 AM |
# 6
|
|
Developer
|
Hi Andy,
such error usually happens when there’s some sort of redirect in .htaccess (for example, forcing all requests to non-www domain to www domain or vice versa)
Try disabling such rule for the directory where you have the files, or make sure you use the domain that does not involve redirection
|
|
|
drudoran
|
Posted: 09 May 2012 05:32 AM |
# 7
|
|
|
Thanks Yuri - if it helps anyone with similar issue - here is the answer…
In the Expression Engine docs, it says to remove the index.php from your site, place this in your htaccess…
<IfModule mod_rewrite.c> RewriteEngine On
# Removes index.php RewriteCond $1 !\.(gif|jpe?g|png)$ [NC] RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^(.*)$ /index.php/$1 [L]
# If 404s, "No Input File" or every URL returns the same thing # make it /index.php?/$1 above (add the question mark) </IfModule>
I just added zip to the file extensions on line 5 as follows
RewriteCond $1 !\.(gif|jpe?g|png|zip)$ [NC]
Now everything’s working fine and zips don’t contain cpgz files anymore
Thanks again for a great module.
Andy
|
|
|
Yuri Salimovskiy
|
Posted: 09 May 2012 08:41 AM |
# 8
|
|
Developer
|
That’s important to know - thanks for sharing!
|
|
|