Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

OsCommerce Download Feature


bkellum

Recommended Posts

I was able to succesfully create a test download, and download the file, but only after manually changing the order status in the customers/orders section of OSC.(sandbox)

 

Is there a way that the order status will be automatically changed to allow download after payment approval by paypal? Having to approve each order manually isn't going to work as I want an almost instant transaction.

 

About sales tax, New York requires each customer to pay their local tax. In Paypal I have set the status of the United States to active. So will that take care of the tax automatically? If so, my site is not going to reflect the total product value with tax included, so what do I do about that?

 

Lastly, the paypal buttons. How do I incorporate the buttons seen on the paypal site? I see the code to cut and paste, but did not have any luck getting it to work. I would like to display their buttons to inspire more confidence in purchasers.

 

 

Thank you for your assistance!

 

 

Todd

Link to comment
Share on other sites

  • 2 weeks later...

Hey Everyone,

I hope someone out there can help me. I've read through this forum and tried the soultions, but I can not get my product to download. I just get a page can not be displayed or if I right click and download I get it can no download from download.php.

 

I have enabled downloading

I enabled download by redirect, because it's hosted on a linux server (i have also tried it with it off)

I have made sure in Product Attributes I have added the file name "JGS289.zip"

I have uploaded the file to download as "JGS289.zip"

I have made sure in include\configure.php that the slash was after the store name

The link appears after purchase...and I can't download it.

 

 

I think I am about rip my hair out, I've reinstalled the store several times to make sure it wasn't something I've done...but I just can't figure it out! Someone please show me where I am going wrong!

Link to comment
Share on other sites

  • 2 weeks later...

Hello everybody,

 

I am very new to downloads and am trying to set my site up to achieve this. This appears to be the best thread I can find on the matter. I have followed all of the instructions detailed at the start of this thread and get the link to the download; however, when I click on the link I get the following error message.

 

Forbidden

You don't have permission to access /testircatalog/pub/.xjxvjczmjhnniwjx/turbo.zip on this server.

Additionally, a 403 Forbidden error was encountered while trying to use an ErrorDocument to handle the request.

 

The permissions are set correctly and I have checked the configure file is correct as well. I have also set the default order status to processing and permitted downloads to that status.

 

I would be grateful if somebody could point me in the right direction.

 

As an aside, I am testing this by setting my payment option as cash on delivery to enable me to process the order completely. When I do this, the payment option does not appear on the payment page. Is this a quirk in the system or is it designed to do that?

 

I look forward to progressing this forward.

 

Ian

Link to comment
Share on other sites

Ok, I tried to read through and find if my problem was covered with no luck.

 

I have everything set the way it's explained. I look at the file and made sure there is a "/" , its there.

 

 

Once I complete transaction, when and where does the customer get the diownload link? Even though I'm selecting download, it still acts like it's shipping.

 

 

The store is not live, but you can test it at http://www.towerdistributions.com/catalog using the cash on delivery as payment.

 

Someone please help!

Link to comment
Share on other sites

Hi there, this thread has really helped but I need something else!! I am setting up a site tht allows customers to upload their items for sale, namely boats!. So there are twolevels of advert for them to select, either bronze or silver, bronze allows on image and silver up to 7 images. I need for the download to be a link to whichever upload page is relevant to their product. Unless someone else can offer help !

Keep passing the open windows.

Link to comment
Share on other sites

One huge issue im having is. OScommerce doesnt recognize it as a download sales unless they click on detail and then add to cart.

 

If they add to cart from the "preview" item, without click on details first. It doesnt sell it as a download sale.

 

Help?

 

 

 

 

 

For those experiencing problems using the download feature in osCommerce.
  1. Enable downloads in the admin/configure/downloads section of your store,
  2. Upload your product to the cataloag/downloads folder as a zip file (using no spaces in the name)
  3. Create a products page as you would normally for any product you sell
  4. Go to admin/catalog/product attributes page. Under "Product Options", create a new option called "Download" or something that you and your customer will recognize.
  5. In the same Product Attributes page, create a Option Value of "YEs" or "Only" or whatever.
  6. Still in the Product Attributes page, at the bottom of the page, you will find a drop down menu of each of your products. Find the product that you wish to offer as a download and select it.
  7. Under the Option Name, choose "Download" or whatever you used in step 4 above.
  8. Under Option Value, choose "yes" or whatever you used in step 5 above.
  9. Set your price for the product or leave blank.
  10. Skip the Prefix section.
  11. Type in the exact name of the download file as it is saved in your catalog/downloads folder as you did in step 2 above. Remember, no spaces in the filename and include the .zip extention.
  12. Set the number of days the purchased download will be available to your customer.
  13. Set the maximum amount of downloads tries you wish to grant to your customer. You should at the very least give your customer 2 tries, in case something happens to thier connection.
  14. Finally, click the "insert" button at the far right.
  15. Your product is now available for download.

:thumbsup:

 

Good Luck,

Bill Kellum

Link to comment
Share on other sites

I'm using the download feature successfully, but found a problem. If the download file is over 33.3 MB, it does't work. The customer just gets a "page cannot be displayed" when the download link it clicked. Anything less than that size works fine, anything larger than that, it doesn't work. So, I found in phpMyAdmin, products_attributes_download, the following information:

 

Space usage

Type - Usage

Data - 24,088 B

Index - 9,216 B

Total - 33,304 B

 

So, the 33,304 B looks like the size limit of what I can have as a download file. That's the same as 33.3 MB, yes? Hmmm, maybe not. Anyway, these numbers, if you look, are not editable. I thought I could just increase it to 100,000 B and fix my problem, but I can't change these numbers as far as I can tell.

 

Any thoughts?

 

Steve Doherty

 

I am having the same problem the customer downloaded a 20mb file but the 24 and 25 mb files were internal error. I replaced with a small zip file and no problem. I dont know where this would be edited. help. my zip files are large, nothing I can do about that.

Link to comment
Share on other sites

  • 2 weeks later...

I am having a problem with the download feature. With Download by redirect Disabled, if the Mp3 file download is larger than 42 MB, then only a 1 kb file is downloaded. Anything less than 42 MB works fine. With Download by redirect Enabled, then any size file (even larger than 42 MB) works fine. But, in my browser anyway, with Download by redirect Enabled, the file takes a long time to download into the browser cache, and then wants to play in the browser with Quicktime, instead of prompting me to download the file. I realize I can configure my browser not to automatically play an Mp3 file in the browser, but there are a lot of customers who will not know how to do that, and it will cause problems/complaints. A large zip file downloads fine, but all my downloads are MP3 files, thousands of them. I don't want to zip them all, plus Some customers are stupid and don't know what to do with a zip file anyway.

 

This size limit problem used to be 33.3 MB. Then I had to move to a newer server (for unrelateed PCI Compliance reasons, moved from PHP4 to PHP5) and now the limit is 42 MB. So, maybe it has something to do with the server settings?

 

I just want it to prompt to download the MP3 file, and download it regardless of the size.

 

So, what exactly is Download by redirect?

Why do I have a 42 MB limit with Download by redirect Disabled?

Anyone have any clues or answers?

 

 

Thanks for any help.

 

Maguai - did you try enabling Download by redirect?

Link to comment
Share on other sites

  • 2 weeks later...

Hi Bill and all the others,

 

I'm also a newbie and I'm also having some problems with the DL

I've read the entire post, checked all points but I cannot find a solution even so I know I must be very close.

 

I'm going to try to explain my problem with my poor english:

 

I have my website hosted on servage.net, and since they offer oscommerce with an auto installer, I decided to give it a try.

 

After running the auto install everything looked fine but when it comes to DL I allways have the same problem.

I create my article, I go in the product attributes where I enable DL and type in the name of the file I just uploaded.

 

When I check my product in the product page, on the top of the producr page, I have this warning message: Warning: No file uploaded. :(

 

If anyone could give me a clue on how to solve this... I would really appreciate.

 

Thanks a Lot.

Emmanuhell

 

PS: Sorry for my shitty english but I do my best ;)

Link to comment
Share on other sites

I have followed all the steps in this and the other threads on how to make this work, I set everything to the specifications suggested and my problem is this:

 

When I click on my Catalog button to view my storefront a red info bar across the top of the screen gives me

 

WARNING:Downloadable products directory does not exist: storesdownload/. Downloadable products will not work until this directory is valid.

 

What in the heck does that mean? If I uploaded my zip file into the downloads folder and followed all the steps laid out here, why is my directory not valid?

Link to comment
Share on other sites

I have followed all the steps in this and the other threads on how to make this work, I set everything to the specifications suggested and my problem is this:

 

When I click on my Catalog button to view my storefront a red info bar across the top of the screen gives me

 

WARNING:Downloadable products directory does not exist: storesdownload/. Downloadable products will not work until this directory is valid.

 

What in the heck does that mean? If I uploaded my zip file into the downloads folder and followed all the steps laid out here, why is my directory not valid?

Either you have a wrong path in your configuration files (both of them) or you have the wrong file permissions on the download folder and/or Pub folders.

Bill Kellum

 

Sounds Good Productions

STS Tutorials & more: STSv4.6, STS Add-ons (STS Power Pack), STS V4 Forum STS Forum FREE TEMPLATE

Link to comment
Share on other sites

How/where do I go to determine if this is the case? There are over 10 folders called pub so how am I supposed to know which one is incorrect?

 

Well, you should only be working within your store's files, not your complete web hosts files. I can't imagine why you would have more than one pub folder unless you have multible osC installations. In any case, find the pub folder for your store's files, usually located in catalog/pub. Also, the "out of the box" download folder is located in catalog/download.

 

Also, be sure you have the following lines setup correctly in the catalog/includes/configure.php file:

(This is how I have mine setup, your paths will be different for the DIR_FS_CATALOG)

 

define('DIR_WS_DOWNLOAD_PUBLIC', 'pub/');

define('DIR_FS_CATALOG', '/home/sounkel6/public_html/eshop/');

define('DIR_FS_DOWNLOAD', DIR_FS_CATALOG . 'download/');

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

Bill Kellum

 

Sounds Good Productions

STS Tutorials & more: STSv4.6, STS Add-ons (STS Power Pack), STS V4 Forum STS Forum FREE TEMPLATE

Link to comment
Share on other sites

This is what my pub directory says, is this correct? Or am I in the wrong directory?

 

<?php

/*

$Id: download.php 1739 2007-12-20 00:52:16Z hpdl $

 

osCommerce, Open Source E-Commerce Solutions

http://www.oscommerce.com

 

Copyright © 2007 osCommerce

 

Released under the GNU General Public License

*/

 

include('includes/application_top.php');

 

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

 

// Check download.php was called with proper GET parameters

if ((isset($HTTP_GET_VARS['order']) && !is_numeric($HTTP_GET_VARS['order'])) || (isset($HTTP_GET_VARS['id']) && !is_numeric($HTTP_GET_VARS['id'])) ) {

die;

}

 

// Check that order_id, customer_id and filename match

$downloads_query = tep_db_query("select date_format(o.date_purchased, '%Y-%m-%d') as date_purchased_day, opd.download_maxdays, opd.download_count, opd.download_maxdays, opd.orders_products_filename from " . TABLE_ORDERS . " o, " . TABLE_ORDERS_PRODUCTS . " op, " . TABLE_ORDERS_PRODUCTS_DOWNLOAD . " opd where o.customers_id = '" . $customer_id . "' and o.orders_id = '" . (int)$HTTP_GET_VARS['order'] . "' and o.orders_status = '3' and o.orders_id = op.orders_id and op.orders_products_id = opd.orders_products_id and opd.orders_products_download_id = '" . (int)$HTTP_GET_VARS['id'] . "' and opd.orders_products_filename != ''");

and o.orders_status = os.orders_status_id and os.downloads_flag = '1' and os.language_id = '" . (int)$languages_id . "'");

if (!tep_db_num_rows($downloads_query)) die;

$downloads = tep_db_fetch_array($downloads_query);

// MySQL 3.22 does not have INTERVAL

list($dt_year, $dt_month, $dt_day) = explode('-', $downloads['date_purchased_day']);

$download_timestamp = mktime(23, 59, 59, $dt_month, $dt_day + $downloads['download_maxdays'], $dt_year);

 

// Die if time expired (maxdays = 0 means no time limit)

if (($downloads['download_maxdays'] != 0) && ($download_timestamp <= time())) die;

// Die if remaining count is <=0

if ($downloads['download_count'] <= 0) die;

// Die if file is not there

if (!file_exists(DIR_FS_DOWNLOAD . $downloads['orders_products_filename'])) die;

 

// Now decrement counter

tep_db_query("update " . TABLE_ORDERS_PRODUCTS_DOWNLOAD . " set download_count = download_count-1 where orders_products_download_id = '" . (int)$HTTP_GET_VARS['id'] . "'");

 

// Returns a random name, 16 to 20 characters long

// There are more than 10^28 combinations

// The directory is "hidden", i.e. starts with '.'

function tep_random_name()

{

$letters = 'abcdefghijklmnopqrstuvwxyz';

$dirname = '.';

$length = floor(tep_rand(16,20));

for ($i = 1; $i <= $length; $i++) {

$q = floor(tep_rand(1,26));

$dirname .= $letters[$q];

}

return $dirname;

}

 

// Unlinks all subdirectories and files in $dir

// Works only on one subdir level, will not recurse

function tep_unlink_temp_dir($dir)

{

$h1 = opendir($dir);

while ($subdir = readdir($h1)) {

// Ignore non directories

if (!is_dir($dir . $subdir)) continue;

// Ignore . and .. and CVS

if ($subdir == '.' || $subdir == '..' || $subdir == 'CVS') continue;

// Loop and unlink files in subdirectory

$h2 = opendir($dir . $subdir);

while ($file = readdir($h2)) {

if ($file == '.' || $file == '..') continue;

@unlink($dir . $subdir . '/' . $file);

}

closedir($h2);

@rmdir($dir . $subdir);

}

closedir($h1);

}

 

 

// Now send the file with header() magic

header("Expires: Mon, 26 Nov 1962 00:00:00 GMT");

header("Last-Modified: " . gmdate("D,d M Y H:i:s") . " GMT");

header("Cache-Control: no-cache, must-revalidate");

header("Pragma: no-cache");

header("Content-Type: Application/octet-stream");

header("Content-disposition: attachment; filename=" . $downloads['orders_products_filename']);

 

if (DOWNLOAD_BY_REDIRECT == 'true') {

// This will work only on Unix/Linux hosts

tep_unlink_temp_dir(DIR_FS_DOWNLOAD_PUBLIC);

$tempdir = tep_random_name();

umask(0000);

mkdir(DIR_FS_DOWNLOAD_PUBLIC . $tempdir, 0777);

symlink(DIR_FS_DOWNLOAD . $downloads['orders_products_filename'], DIR_FS_DOWNLOAD_PUBLIC . $tempdir . '/' . $downloads['orders_products_filename']);

if (file_exists(DIR_FS_DOWNLOAD_PUBLIC . $tempdir . '/' . $downloads['orders_products_filename'])) {

tep_redirect(tep_href_link(DIR_WS_DOWNLOAD_PUBLIC . $tempdir . '/' . $downloads['orders_products_filename']));

}

}

 

// Fallback to readfile() delivery method. This will work on all systems, but will need considerable resources

readfile(DIR_FS_DOWNLOAD . $downloads['orders_products_filename']);

?>

Link to comment
Share on other sites

Well, you should only be working within your store's files, not your complete web hosts files. I can't imagine why you would have more than one pub folder unless you have multible osC installations. In any case, find the pub folder for your store's files, usually located in catalog/pub. Also, the "out of the box" download folder is located in catalog/download.

 

Also, be sure you have the following lines setup correctly in the catalog/includes/configure.php file:

(This is how I have mine setup, your paths will be different for the DIR_FS_CATALOG)

  define('DIR_WS_DOWNLOAD_PUBLIC', 'pub/');
 define('DIR_FS_CATALOG', 'stores');
 define('DIR_FS_DOWNLOAD', DIR_FS_CATALOG . 'download/');
 define('DIR_FS_DOWNLOAD_PUBLIC', DIR_FS_CATALOG . 'pub/');

Link to comment
Share on other sites

  • 2 weeks later...

Okay so I followed these directions and its working perfectly Bill. Thanks!

 

An option I need, is for when I update their order to "Digital Download Approved" after I receive payment (via CC/paypal) the current OSC doesn't notify the customer HOW to retrieve their download. Is it possible to send the download link to the item when OSC sends the updated order email?? or where could I edit that email to include special text telling the customer how to retrieve the download. Face it, there's idiots out there who won't be able to figure out to check their order history without "plain and spelled out directions".

 

any help would be appreciated, thanks!

Link to comment
Share on other sites

Troubleshooting if download link does not work:

 

 

 

In your catalog/includes/configure.php file, down in the downloads section, their maybe a

 

missing "/" in your catalog name:

 

  define('DIR_WS_DOWNLOAD_PUBLIC', 'pub/');
 define('DIR_FS_CATALOG', '/home/sounkel6/public_html/catalog');
 define('DIR_FS_DOWNLOAD', DIR_FS_CATALOG . 'download/');
 define('DIR_FS_DOWNLOAD_PUBLIC', DIR_FS_CATALOG . 'pub/');

 

It should be:

 

  define('DIR_WS_DOWNLOAD_PUBLIC', 'pub/');
 define('DIR_FS_CATALOG', '/home/sounkel6/public_html/catalog/');
 define('DIR_FS_DOWNLOAD', DIR_FS_CATALOG . 'download/');
 define('DIR_FS_DOWNLOAD_PUBLIC', DIR_FS_CATALOG . 'pub/');

 

Where "catalog" is the name of your store.

 

Now your download link will work perfectly. Yippee!! Woo Hoo!!!

 

Bill Kellum Hello!

Dear Bill!

I installed the Super Download Shop v1.0 and Downloads Controller v5.3.2b for Online Merchant v2.2 Release Candidate 2a (v5.3.2c).

I am using at the moment osCommerce-2.2rc2a in Portuguese. - I have in the group of the Software-2.2rc2a.zip added osCommerce file to download, already set up in the database the status 11 and 12 or Authorized Download Download and complete, but the button to download the link does not appear in home. The download folder has permissions 755 and apasta pub has allowed 777 in my confg.php is thus:

define ( 'DIR_WS_DOWNLOAD_PUBLIC', 'pub /');

define ( 'DIR_FS_CATALOG', '/ home / xxxxxx / public_html / catalog /');

define ( 'DIR_FS_DOWNLOAD', DIR_FS_CATALOG. 'download /');

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

Nor does the system for download.

Can you help me?

You can access the site HTTP: / / www.joaoboa.com.br

Thank you in advance for your attention

Bejotafree

Link to comment
Share on other sites

  • 3 weeks later...
My problem is that even though its a downloadable people still get the shipping process page

and that confuse them totally How do i skip the shiping process?

 

This sounds like you don't have the correct product attributes set.

Bill Kellum

 

Sounds Good Productions

STS Tutorials & more: STSv4.6, STS Add-ons (STS Power Pack), STS V4 Forum STS Forum FREE TEMPLATE

Link to comment
Share on other sites

Bill Kellum Hello!

Dear Bill!

I installed the Super Download Shop v1.0 and Downloads Controller v5.3.2b for Online Merchant v2.2 Release Candidate 2a (v5.3.2c).

I am using at the moment osCommerce-2.2rc2a in Portuguese. - I have in the group of the Software-2.2rc2a.zip added osCommerce file to download, already set up in the database the status 11 and 12 or Authorized Download Download and complete, but the button to download the link does not appear in home. The download folder has permissions 755 and apasta pub has allowed 777 in my confg.php is thus:

define ( 'DIR_WS_DOWNLOAD_PUBLIC', 'pub /');

define ( 'DIR_FS_CATALOG', '/ home / xxxxxx / public_html / catalog /');

define ( 'DIR_FS_DOWNLOAD', DIR_FS_CATALOG. 'download /');

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

Nor does the system for download.

Can you help me?

You can access the site HTTP: / / www.joaoboa.com.br

Thank you in advance for your attention

Bejotafree

 

You would most likely get a better answer in either of the Super Download Shop v1.0 and Downloads Controller v5.3.2b support threads by "Alex"

Bill Kellum

 

Sounds Good Productions

STS Tutorials & more: STSv4.6, STS Add-ons (STS Power Pack), STS V4 Forum STS Forum FREE TEMPLATE

Link to comment
Share on other sites

  • 3 weeks later...
For those experiencing problems using the download feature in osCommerce.
  1. Enable downloads in the admin/configure/downloads section of your store,
  2. Upload your product to the cataloag/downloads folder as a zip file (using no spaces in the name)
  3. Create a products page as you would normally for any product you sell
  4. Go to admin/catalog/product attributes page. Under "Product Options", create a new option called "Download" or something that you and your customer will recognize.
  5. In the same Product Attributes page, create a Option Value of "YEs" or "Only" or whatever.
  6. Still in the Product Attributes page, at the bottom of the page, you will find a drop down menu of each of your products. Find the product that you wish to offer as a download and select it.
  7. Under the Option Name, choose "Download" or whatever you used in step 4 above.
  8. Under Option Value, choose "yes" or whatever you used in step 5 above.
  9. Set your price for the product or leave blank.
  10. Skip the Prefix section.
  11. Type in the exact name of the download file as it is saved in your catalog/downloads folder as you did in step 2 above. Remember, no spaces in the filename and include the .zip extention.
  12. Set the number of days the purchased download will be available to your customer.
  13. Set the maximum amount of downloads tries you wish to grant to your customer. You should at the very least give your customer 2 tries, in case something happens to thier connection.
  14. Finally, click the "insert" button at the far right.
  15. Your product is now available for download.

:thumbsup:

 

Good Luck,

Bill Kellum

 

Bill,

I have tried all the above, but constantly get an error. I have posted this in another topic:

http://www.oscommerce.com/forums/index.php?showtopic=329050

Perhaps you could take a look at that, and give me any help you can?

Paul

Link to comment
Share on other sites

Bill,

I have tried all the above, but constantly get an error. I have posted this in another topic:

http://www.oscommerce.com/forums/index.php?showtopic=329050

Perhaps you could take a look at that, and give me any help you can?

Paul

You are experiencing a PHP 5 compatibility issue.

Bill Kellum

 

Sounds Good Productions

STS Tutorials & more: STSv4.6, STS Add-ons (STS Power Pack), STS V4 Forum STS Forum FREE TEMPLATE

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
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
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...