Jump to content

Downloads failing


GreenApple

Recommended Posts

Hi all,

Cubecart version 5.2.5 - custom skin

I'm at a complete loss as to what's happened here. Everything has been working fine for just over a year, and now suddenly customers are unable to download any of the files they've purchased - either free, or paid for. I've not changed anything, I've checked that the file paths are correct, and all seems to be OK as far as I can see.

The customer can go through checkout just fine, but clicking on the download link in the confirmation email just takes them to their account. Clicking on the download link in the "Your Digital Downloads" section does absolutely nothing at all.

This is a link to one of my free downloads so you can see what I mean:
https://shop.jigsawknits.co.uk/index.php?_a=product&product_id=116

Thanks for any help!

Link to comment
Share on other sites

I just now clicked the Download File link on that page and my browser opened up its internal PDF viewer and displayed the page.

To learn why there seems to be nothing happening when clicking a "Download" link in the customer's Account, Download page, we would first want to know if the browser is even sending the page request off into the Internet. To do that, your browser should have a "Developer's Console". In that console, you can see the page request and everything that the browser receives as a reply from that request. (It's called a "waterfall" network chart.)

Link to comment
Share on other sites

Hi thanks, though I don't think I explained myself very well :)

That Download File link is just there for customers to download the free file directly, instead of having to go through the process of adding items to the cart. The problem is where customers are ordering either free downloads, or paid-for downloads, through the shopping cart. Payment is taken, and checkout completes correctly, no problems there. The problem happens either when they click on the link in their "Your Purchased Downloads" email, or try to download from the link in their account. In both cases, nothing happens. This is happening to every single customer - I've tried several test orders, and it happens to me as well in all browsers.

This is the content of the email "Your Purchased Downloads", clicking on the link should start the file download. All it does is take a logged in customer to their account, or anyone else to a page with no content in the centre section.

---------------------
Your files are now ready for download. Please use the links provided below to access them - you have three attempts to download each file.

Raglan Sleeve V Neck Sweater, Machine knitting pattern. Free download: (Link expires on Dec 08 2015, 10:56 AM)
http://shop.jigsawknits.co.uk/index.php?_a=download&accesskey=fee188ed2c932450a83d004e7f208202

You can also access these files from your customer area of our website.
---------------------

When the customer goes into their account and clicks the download link, nothing happens. It's the same for all customers, and for me as well. I'm completely baffled, as this has just suddenly started happening in the last week. Before that, everything was working perfectly... and I haven't changed a thing...

Link to comment
Share on other sites

Ok. Are you familiar with phpMyAdmin (or some other external utility that will allow you to examine the database directly)?

If so, please examine CubeCart_downloads and find the record that has the accesskey that starts with 'fee188'. (It may help to sort the table on the accesskey column.) We are just confirming that this database record exists.

When CubeCart is told to deliver a file, several checks are made: the order exists and has been paid for, and hasn't timed out or been downloaded more than the allowed number of times, If any of those "errors" are true, the customer should be shown why the download was denied.

So, perhaps there is a PHP error happening. Please find the PHP error log file and let us know what the latest few entries say after having made a download attempt.

Your description of what happens is what the code suggests when the accesskey is not received by CubeCart.

So, considering this is happening to everyone, and your sample of the download link is correct, we must therefore assume the web server, or some server-installed PHP security appliance, is dropping the accesskey and/or the hash value from the $REQUEST array.

Please contact your hosting provider and ask if they installed some sort of security measure that might affect a querystring with a 32-character hash code.

If you are interested, I have a diagnostic file that will show what CubeCart is given when a page request is made to your store. It will show if the accesskey is being received by CubeCart. Send me a PM with your email address if you think we need to pursue this - that is, if your host states they have not done anything to cause this.

Link to comment
Share on other sites

Thanks for your reply.

Well, I've been into the database with mixed results. The record with the accesskey that starts with 'fee188' is missing.

However.... this is another link that failed, but this time the record with this accesskey is there in the database so it's not consistent.
http://shop.jigsawknits.co.uk/index.php?_a=download&accesskey=6a96206ccbcdf13f228c5febd5d22a0d

I can't find the PHP error log unfortunately. Presumably it would be in the root of the server, or in the LOG folder?

As far as the web host is concerned, way back in October they upgraded my hosting from Zeus to Apache. There were no problems with the upgrade, everything went OK and continued to work until this problem started last week. According to them they've done nothing since, but I'll ask again about the security measure, The only thing that they said "may" have gone wrong with the upgrade is this:
"On the old Zeus web platform, rewrite rules were defined using a Zeus rewrite script called rewrite.script. On the Apache platform, this functionality is provided by .htaccess's mod_rewrite. If your site was using a Zeus rewrite script, in the majority of cases we have been able to provide an equivalent mod_rewrite rule, which we have inserted into your .htaccess file"
And this is all that's in my htaccess file:
AddHandler php54-script .php .php5

Whether this has anything to do with what's happening, I have no idea... :)

Link to comment
Share on other sites

We will force PHP to make an error_log and locate it in Cubecart's main folder.

Please create a file called 'ini-custom.inc.php', and have as its contents:

<?php
# Custom initialization commands
# Filename: ini-custom.inc.php
# File location: main CubeCart folder

ini_set('memory_limit', '256M');
ini_set('max_execution_time', '60');
ini_set('error_log', 'error_log');
ini_set('log_errors', 'on');

?>

Place this file in CubeCart's main folder. When you try to download a purchased digital product, you may now find a file named 'error_log' in the main CubeCart folder.

Let us know what gets logged here.

But now, the accesskey that starts with '6a96' -- did you 'reset' it's expiration so that it would (should) not fail to be delivered?

The .htaccess file is fine.

 
Link to comment
Share on other sites

OK... so the ini-custom.inc.php file is in the main CubeCart folder, and I created a test order. There is no PHP error log. I then tried clicking on the links that had previously been generated, but still no error log.

This is the link that was generated by my latest test order, again it doesn't lead to the file download. This record/accesskey is in the database:
http://shop.jigsawknits.co.uk/index.php?_a=download&accesskey=a2d43e95bf882d19ba1b0fe6c35791df

>> the accesskey that starts with '6a96' -- did you 'reset' it's expiration so that it would (should) not fail to be delivered?

No I didn't, not for this link. I did however reset a link from several months ago that I knew had worked OK in the past. When I reset it, it no longer worked!

Link to comment
Share on other sites

Ok, no error_log, then presumably, no errors were being generated.

It seems to me the only thing left is that 'accesskey' and/or the value is getting chopped off from the querystring (the part of the URL after the questionmark).

To test this, we will need to dig deeper.

Having purchased CubeCart 5.2.5, you may still have some support credits. Whether those credits can be used to find and fix this problem with CC525, I do not know. And if the problem actually exists with your hosting provider, I don't know what would happen in that scenario either. But there is no harm in asking.

I am interested in seeing what is happening. So, if you wish, send me a PM with your email address and we will take this to email.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...