After analyzing what I found is, download code of Magento gives 404 not found code for the downloadable product with space in filename. After removing the space from filename and updating via above SQLs fixed my issue:
UPDATE downloadable_link SET link_url = 'http://my-store.com/media/downloadable/files/links/m/y/mysoftware-v202.zip';
UPDATE downloadable_link_purchased_item SET link_url = 'http://my-store.com/media/downloadable/files/links/m/y/mysoftware-v202.zip';
Note: More detail on the Magento code that causes the issue and how to clean up over here...
The Magento backup system in 1.6 and later has an unfortunate feature where it will change certain file/folder permissions which then can fall afoul of security measures like SuExec, SuPHP or cPanel WHM settings.
The root error that causes a 500 error page will show in the server log. The server error log should be available in your cPanel or in a log folder in your account folder. If not, you can contact your hosting provider to tell you what the errors for the 500 error are being recorded.
Often, clearing the 500 error is as simple as using WinSCP to change permissions. The vile and stupid change often is that index.php
in your Magento root folder is given permissions of 666 (readable and writable by everyone) instead of the 644 or 664 permissions that don't violate system security checks. Also check for a file in your magento root called maintenance.flag
and delete it.
In worst-case scenarios, the backup can change all file/folder permissions and you then have to run a script to change folder permissions to 755 and file permissions to 644.
Magentocommerce help page for setting file permissions
Given that Magento An e-Bay Inc. Company has allowed some pages to cease existence on their website, transferring the meat of the subject here to link-rot proof. For Magento 1.5+ as follows:
Here’s how to reset your file and directory permissions if PHP is running through FastCGI, suPHP, or LSAPI:
find . -type f -exec chmod 644 {} \;
find . -type d -exec chmod 755 {} \;
chmod 550 mage
YMMV depending on hosting provider, files 664 and directories 775 MAY be needed
If PHP is running as a module (DSO), you will need to do this:
sudo find . -type f -exec chmod 644 {} \;
sudo find . -type d -exec chmod 755 {} \;
sudo chmod o+w var app/etc
sudo chmod 550 mage
sudo chmod -R o+w media
On that page is mentioned the Magento Cleanup Tool (as long as it's still available) which is run as a php script. Several people recommend running it after every Magento Admin panel system backup.
Of course, the way around it is to dispense with the Magento system backup till they fix it and use a combined tarball/mysqldump backup as a manual scripted operation or to set up another system and use rsync and do a cron scripted gzipped mysql dump that is pulled over when the rsync backup is run.
Best Answer
There may be multiple reason for this. First you need to find out whether Magento gives any errors (exception, errors, report) while you're trying to download the link. Go through - Fundamentals of Debug a Magento store and come again with more details.
For now I can say that, you need to dig in the method
linkAction()
which is available in the controller classMage_Downloadable_DownloadController
that is located atapp/code/core/Mage/Downloadable/controllers/DownloadController.php
. More specifically, this is the part of code that you need to dig into.See the
catch
section and lastelse
sectionTry to log the error happens there. You can use
Mage::log()
function for that. Use this for more details on logging.