Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Downloads don't work


peterpiper

Recommended Posts

I have spent many hours in this forum, in Google and in the code trying to find the cause of this problem, but to no avail.

 

We are at this stage using only Paypal for payments, and it is going through their sandbox (if that makes any difference, although I can't see how). It does everything it should up to when you try to download the file in question. The problem is still there even if you log out and back in, then go to "My Account" and try to download the file.

 

When you click on the link, something like "http://OURURL.com/store/download.php/order/4/id/2?osCsid=521bfa9ff468152e46bda76871a068d0" it takes you to the page, but the page stays blank. There is no source to view, so it is seriously empty.

 

I have found through playing with the code that it is stopping at the line:

if (!tep_session_is_registered('customer_id')) die;

in download.php

 

This function "tep_session_is_registered()" is in includes/functions/sessions.php, but the whole function consists of:

function tep_session_is_registered($variable) {

return session_is_registered($variable);

}

 

The big problem I am having tracing it from here is that I can only find this function "session_is_registered()" in includes/classes/sessions.php (and the admin version of the same file), but even if I comment the entire function out I get the same result, and no unknown function error. I also tried making the only line in the entire function echo "Hi" to the screen, but nothing happens.

 

This to me indicates that it is using a "session_is_registered()" function in another file, but I cannot for the life of me find it.

 

I have tried a clean install (other than the database), so it's not in the files themselves.

I have installed the whole thing on my home testing server, with the same result.

I have followed instructions mentioned in this forum to verify that downloads are enabled etc.

The ONLY thing I have kept across all my testing is the contents of the database, but I wouldn't even begin to know where to look for whatever has been causing this.

I have tried Opera, Mozilla and Internet Explorer (although all on Linux), but I can't see how that should be a problem.

I have made sure that the correct symlink is being made in the correct directory for the correct file, and if I go to that file directly in the browser it downloads.

 

Basically as far as I can see it comes down to "if (!tep_session_is_registered('customer_id')) die;" messing with my mind.

 

Please explain where I/it am/is going wrong and restore my sanity!

 

Thanks in advance.

Link to comment
Share on other sites

Hi

 

not sure if this helps but have you tried the download controller contrib?

:-)

Monika

 

addicted to writing code ... can't get enough of databases either, LOL!

 

my toolbox: Textpad - Compare and Merge - phpMyAdmin - WS_FTP - Photoshop - How to search the forum

 

Interactive Media Award July 2007 ~ category E-Commerce

my advice on the forum is for free, PMs where you send me work are considered consultation which I charge for ...

Link to comment
Share on other sites

not sure if this helps but have you tried the download controller contrib?

 

Actually I have just finished installing it. Is it just me or is it missing some instructions?

 

Anyway, I've got it to run without errors, but it still doesn't actually give me any file to download. :-(

In case this is relevant, I have noticed that the page first loads with the address in the href (http://192.168.1.1/store/download.php/order/2/id/1?osCsid=25337d4552ae09b56af12aba0e6df620), but then very quickly refreshes to http://192.168.1.1/store/download.php/orde...aything-pdf.zip

 

Notice that the value of 'id' has been changed from "1" to "pub" and of course the osCsid has been replaced with the pub directory and the download name.

 

After the refresh it now stops somewhere inside application_top.php as included by download.php

 

I'm still digging, and wondering why I'm special enough to get this problem. ;-)

Link to comment
Share on other sites

Actually I have just finished installing it. Is it just me or is it missing some instructions?

 

Anyway, I've got it to run without errors, but it still doesn't actually give me any file to download. :-(

In case this is relevant, I have noticed that the page first loads with the address in the href (http://192.168.1.1/store/download.php/order/2/id/1?osCsid=25337d4552ae09b56af12aba0e6df620), but then very quickly refreshes to http://192.168.1.1/store/download.php/orde...aything-pdf.zip

 

Notice that the value of 'id' has been changed from "1" to "pub" and of course the osCsid has been replaced with the pub directory and the download name.

 

After the refresh it now stops somewhere inside application_top.php as included by download.php

 

I'm still digging, and wondering why I'm special enough to get this problem. ;-)

 

are you using search engine friendly urls from the admin panel or a contrib?

:-)

Monika

 

addicted to writing code ... can't get enough of databases either, LOL!

 

my toolbox: Textpad - Compare and Merge - phpMyAdmin - WS_FTP - Photoshop - How to search the forum

 

Interactive Media Award July 2007 ~ category E-Commerce

my advice on the forum is for free, PMs where you send me work are considered consultation which I charge for ...

Link to comment
Share on other sites

are you using search engine friendly urls from the admin panel or a contrib?

 

<gushing>

Thank you, thank you, thank you!

</gushing>

 

Before answering your question above I went looking in _that_ direction.

 

It turned out that the problem was twofold:

1. Downloads do NOT appear to work (at least for me) with search engine friendly URLs turned on.

2. In my includes/configure.php the line that reads

define('DIR_FS_CATALOG', '/home/html/catalog/');

in my original file for some reason reads

define('DIR_FS_CATALOG', dirname($HTTP_SERVER_VARS['SCRIPT_FILENAME']));

in my running store. If I change it back other parts of the store don't work. So I then had to change (still in includes/configure.php)

define('DIR_FS_DOWNLOAD_PUBLIC', DIR_FS_CATALOG . 'pub/');

to

define('DIR_FS_DOWNLOAD_PUBLIC', DIR_FS_CATALOG . '/pub/');

and all appears to be well. Stress testing it will come tomorrow.

 

Thanks again for your help.

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...