Hi experts,
I made some changes in module for my needs. I delete ’’free download’’ module from it. Now I put two pdf buttons for download before purchase. http://uzar.com.tr/digishop/ Grey button works for adding into cart and green buttons for product specifications.
Now I create a new column for filename2(second green button) I can upload two pdf files w?thout any problem but when I click on them I got same pdfs getting downloaded. You can verify the problem by trying on first and second green buttons.
The changes I made in download.php: http://www.ipaste.org/nQj
I will appreciate If you can tell my faults in this file or if any additional changes in other files required.
ps: upload works flawless, download just works for one pdf.
Experts told to solve the problem;
The problem is you are using the same url token for both filesfree=acc68c9b5c372e34950b7fad3abf20cb
Create another token field within mod_digishop table, than assign unique token to your second file. After that you would need to modify download.php in /modules/digishop/. See modified section of download.php file here: http://pastebin.com/2GKmxJZw
Once done, make sure that your second file url starts with download.php?free2=$token.
You can of course change get variable free2 to something else.
[php] if (isset($_GET[‘free’]) or isset($_GET[‘free2’])) {
$freefile = isset($_GET['free']) ? $_GET['free'] : $_GET['free2'];
$row = $digishop->getFreeDownload($freefile);
… All remain the same…[/php]
How can I make my download.php file above?
download.php
[php]<?php
/**
- Download
- @package CMS Pro
- @author wojoscripts.com
- @copyright 2014
-
@version $Id: download.php, v4.00 2014-01-10 10:12:05 gewa Exp $
*/
define("_VALID_PHP", true);
require_once ("…/…/init.php");
require_once (MODPATH . “digishop/admin_class.php”);
Registry::set(‘Digishop’, new Digishop());
$digishop = Registry::get(“Digishop”);
define(‘BASE_DIR’, $digishop->filedir);
$allowed_ext = array(
‘zip’ => ‘application/zip’,
‘rar’ => ‘application/x-rar-compressed’,
‘pdf’ => ‘application/pdf’,
‘doc’ => ‘application/msword’,
‘xls’ => ‘application/vnd.ms-excel’,
‘ppt’ => ‘application/vnd.ms-powerpoint’,
‘exe’ => ‘application/octet-stream’,
‘gif’ => ‘image/gif’,
‘png’ => ‘image/png’,
‘jpg’ => ‘image/jpeg’,
‘jpeg’ => ‘image/jpeg’,
‘mp3’ => ‘audio/mpeg’,
‘wav’ => ‘audio/x-wav’,
‘mpeg’ => ‘video/mpeg’,
‘mpg’ => ‘video/mpeg’,
‘mpe’ => ‘video/mpeg’,
‘mov’ => ‘video/quicktime’,
‘avi’ => ‘video/x-msvideo’);
set_time_limit(0);
if (ini_get(‘zlib.output_compression’)) {
ini_set(‘zlib.output_compression’, ‘Off’);
}
?>
admin_class.php They said that the problem in this file.