Forums / Setting Up Categories, Products, Attributes / Redirect downloads not working - permissions issue?

Redirect downloads not working - permissions issue?

Started by timprotech on 9 Mar 2013, 9:09 PM · Views: 818

Results 1 to 5 of 5
9 Mar 2013, 9:09 PM
#1
timprotech avatar

timprotech

New Zenner

Join Date:
Mar 2007
Posts:
9
Plugin Contributions:
0

Redirect downloads not working - permissions issue?

I have been through all the tutorials, FAQs, and posts here related to redirected downloads. In my case:

  1. Product attributes are configured properly (and files are green-lighted), they can be purchased and zencart provides a download link.

  2. Redirect is on in zencart admin

  3. Symlinks are on in apache

  4. Permissions on all directories are 777 (pub, download, and all files below them for good measure)

  5. Hidden folders with symlinks ARE created in pub

  6. Symlinks point to the files in download (I checked via ssh)

  7. configure.php points to download folder

  8. Customers get a permissions error when clicking the link.

Downloads work with redirect turned off, but that's not an option for this client.
Any ideas?

10 Mar 2013, 7:35 AM
#2
kobra avatar

kobra

Black Belt

Join Date:
Aug 2005
Location:
Arizona
Posts:
31,500
Plugin Contributions:
4

Re: Redirect downloads not working - permissions issue?

Permissions on all directories are 777
Many servers will not operate with 777 as permissions
Try folders at 755 and files at 644

Or use ftp and transfer a folder with one file in it - check what server defaults to for permissions

Zen-Venom Get Bitten

10 Mar 2013, 7:36 AM
#3
rodg avatar

rodg

Deceased

Join Date:
Jan 2007
Location:
Australia
Posts:
6,263
Plugin Contributions:
4

Re: Redirect downloads not working - permissions issue?

Take a look at the .htaccess file in your downloads folder.

Are the type of files that you have for downloading listed in the 'FilesMatch' list?

Be careful of the '777' permissions. Although this is the least restrictive setting, some systems are configured to dissallow this because they aren't restrictive enough. 755 or 775 my be a better option.

Cheers
Rod

NOTE: We are sorry that Rod is no longer with us.
We are grateful for all his contributions to the Zen Cart community.

Ozpost - The Ultimate Shipping module for Australian Merchants. Click these links for its Homepage, or Download from Zen-Cart.com.

11 Mar 2013, 5:51 PM
#4
timprotech avatar

timprotech

New Zenner

Join Date:
Mar 2007
Posts:
9
Plugin Contributions:
0

Re: Redirect downloads not working - permissions issue?

kobra:

Many servers will not operate with 777 as permissions
Try folders at 755 and files at 644

Thanks for responding.

FilesMatch in .htaccess was the first thing I verified (sorry I forgot to mention that).

I tried all reasonable permission settings for directories and files before I posted, most restrictive to least. Nothing worked.

I solved the issue in a different way. I turned off redirect and moved the files to a directory outside the web root; making the adjustment in configure.php's, of course. Works perfectly now, and the files are more secure as well.

Details here, for those interested:
http://www.zen-cart.com/content.php?257-how-do-i-relocate-my-download-folder-outside-my-webroot-for-better-security

12 Mar 2013, 1:18 PM
#5
rodg avatar

rodg

Deceased

Join Date:
Jan 2007
Location:
Australia
Posts:
6,263
Plugin Contributions:
4

Re: Redirect downloads not working - permissions issue?

timprotech:

I solved the issue in a different way. I turned off redirect and moved the files to a directory outside the web root; making the adjustment in configure.php's, of course. Works perfectly now, and the files are more secure as well.

Details here, for those interested:
http://www.zen-cart.com/content.php?257-how-do-i-relocate-my-download-folder-outside-my-webroot-for-better-security

Thanks. I consider that solution to be so good (from a security perspective) that I'm not even interested in figuring out the 'real' cause of the problem.

Quite unusual for me, 'cos I'm usually far more interested in fixing the actual problem rather than using a work-around. Just goes to show, there is an exception to every rule :)

Cheers
Rod

NOTE: We are sorry that Rod is no longer with us.
We are grateful for all his contributions to the Zen Cart community.

Ozpost - The Ultimate Shipping module for Australian Merchants. Click these links for its Homepage, or Download from Zen-Cart.com.