Many hours have been spent writing and supporting this contribution. If it helped you out (and is making you money),
donations are a great way of saying "Thanks!"
Super Download Shop contribution is an enhancement of the osCommerce download module and download file management, including following features:
Secure download for pending orders based on DownLoads Controller
v5.3 by Linda McGrath which was the best solution to secure downloads. Without similar control, customers could get their downloads before they
actually pay.
Group files download per product which enable download shops to offer multiple files in a single product. With this ability, shop owners can:
Break a large download file into a group of files, to prevent problems like insufficient resource, time out errors...etc.
Bundle multiple downloads in one package to increase sells.
Store download files in sub folders under the download directory to improve the file management.
Improve reliability when download by redirect not enabled.
Built-in superior file management interface in admin panel.
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
The download settings in admin panel under Configuartion -> Download needs to be setup correctly for this contribution to work properly.
Enable download
Must set to true.
Download by redirect
NOT recommened to set this to true unless the non-redirect method doesn't work. Set this to true only if hosting on Unix/Linix, will save the required system resource.
Do NOT set this to true if hosting on Windows, otherwise the download won't work.
Please refer to the Direct vs Redirect section for further info.
Expiry delay (days)
Default setting for a download link to expire in days. The similar setting in products attributes will override this one on each product.
Maximum number of downloads
Default setting for how many times a download link can be used. The similar setting in products attributes will override this one on each product.
Downloads Controller Update Status Value
You can reset the download expiry for each order, to re-enable an expired download under Customers -> Orders panel.
The value set in this field is for the updated/reset order status. This value must exceeds the Downloads Controller Order Status Value. (See below)
Downloads Controller Download on hold message
Define the message shown when a download is blocked by Downloads Controller.
Downloads Controller Order Status Value
This is the most important setting for Downloads Controller to work. The value set in this field is the gate for orders to reach download accesses.
Downloads Controller will block download accesses from orders which have the order status value below this setting.
Note: The stock osCommerce download module grants download access immediately after the order created in databse. It doesn't check any order status.
Payment modules like eCheck, PayPal IPN...etc, which create orders before the payments completed, can cause serious problems. Customers are able to download
their products and then cancel the payments.
Enable Group File Download?
Set this to Yes will enable the group files for download feature.
For this contribution to work properly, the orders status need to be managed. Please follow the instruction below:
Many people have trouble setting orders status to work with Downloads Controller, there for a step-by-step guide with screen shots provided
here.
In osCommerce admin panel, under Localization -> Orders Status, insert 2 new orders status:
Download Now Available
Updated
And the new list may look like this:
Open phpMyAdmin and load the database assigned to your osCommerce.
Select orders_status table.
Click on the Browse tab.
Edit the new orders status' orders_status_id values. The Downloads Controller Order Status Value defaults to 10 by this contribution (4 in the Downloads
Controller v5.3), we need to set both new orders status above 10 for them to reach download accesses. The Updated orders status id value must set as the one set
in Configuration -> Download -> Downloads Controller Update Status Value. The edited new value may look like this:
In Payment modules which provided a Completed orders status setting, you can set it to the new Download Now Available status, or edit the
Completed orders_status_id to a value above 10. With Downloads Controller, only those orders with an orders_status_id value exceeds 10 can have a working
download link.
You may also need to modify other orders_status_id to be blocked by Downloads Controller, by setting the id value lower than 10 (or what ever you set to the
Downloads Controller Order Status Value).
The File Groups panel is under Catalog -> Products Attributes.
To use the File Groups feature, first upload some .zip or .rar files to your catalog/download folder.
Please notice that you must chmod catalog/download folder to 777, and check if the .htaccess file is in there. osCommerce uses this file to
secure the download folder and keeps it from any direct access via browsers or agents. If the .htaccess file is missing, the download folder is not secured.
You also need to chmod catalog/pub folder to 777, for download by redirect to work. It requires the .htaccess file to be secured as well.
If you want to store files in sub folders under catalog/download folder, you need to chmod those sub folders to 777 as well.
In Catalog -> Products Attributes pannel, first create a file group and assign a group name for at least one language.
Then you can add files to the group just created one by one, or add multiple files in a folder at one time. The File Description will be shown at the front end
download pages (checkout_success.php or account_history_info.php) behind the product name.
You can assign the file group to a product attribute, by using the File Group drop down menu at the bottom of Products Attributes panel. If you want to switch
back to use single filename, you must set No File Group (group id #0) to the product attribute and then change the filename.
What is Download by Redirect?
Download by redirect only works on Unix/Linux servers. It creates an invisible temporary subfolder and a symbolic link to the actual download file through this
temporary folder, then redirects the user's browser to this symbolic link. In this way, the actual location of the download file is hidden, and save the
server resource as well while downloading.
Why Download by Redirect doesn't work on Windows servers?
The function symlink(), which creates the symbolic links, is not implemented on Windows platforms.
Why Download by Redirect is not recommended?
The stock download.php utilizes the header() magic to force the 'Save As' dialog to show up, no matter download by redirect enabled or not. However, the
header() magic doesn't work well with download by redirect if you have a download file extension which can be opened in the browser,
such as .pdf .mp3 .jpg ...., etc. The download file will be opened in the browser, and the reusable symbolic link is shown in the URL line, which can cause
serious security problems. (Thanks to tbreslow for pointing this out in the support thread)
There is no way to destory the reusable symbolic link and the temporary folder immediately after the download job done. The link remains until the next
time when the download by redirect code is called, all temporary folders and links previously created will then be cleaned up. Security breach might exist if
the user grabbed the redirected URL by using a custom browser and share it with others.
Super Download Shop v1.1 improved the reliability of the non-redirect download code. The old problems caused by insufficient system resource and the script
execution timeout have been taken care of. When download by redirect is disabled, the stock download.php uses the function readfile() to send the downlod file
via system memory. Significant system resource is required in this way, especially for large files. In Super Download Shop v1.1 the readfile() function has
been replaced by a buffered fread() loop to save the system resource, and sets the execution time limit to zero to prevent the default 30sec timeout. With
these modifications, the reliability of non-redirecting download is improved.
By using the direct method, there is no reusable link for downloads, there for it is recommended. Do not set
download by redirect to true unless you have problem with the direct method.
GZip compression doesn't work well with downloads. It might bring up a blank page rather than the 'Save As' dialog box. To work around this issue,
please follow the instruction below:
Find in catalog/includes/application_top.php around line 74:
Replace with:
THIS IS RELEASED WITH NO WARRANTY WHATSOEVER!
Use at your own risk!!
Before Adding This Contribution To Your Online Shop, You Should Back Up All Files Related To This Contribution and your database as well.