Ecommerce software home
Shopping Cart Software Forum for Ecommerce Templates
 
Home | Profile | Register | Active Topics | Members | Search | FAQ
Username:
Password:
Save Password
Forgot your Password?

Find us on Facebook Follow us on Twitter View our YouTube channel
Search our site
 All Forums
 Technical
 PHP (Unix / Linux / Apache) versions
 Digital Downloads installation
Author « Topic »  

John Nolan
Advanced Member

Canada
406 Posts

Posted - 09/28/2020 :  16:37:21  
After installing the package, where should the download functions appear? I'm not finding them.

I'm pretty sure I performed the steps correctly, and I ran the updater twice.

John Nolan
Advanced Member

Canada
406 Posts

Posted - 09/28/2020 :  17:36:52  
Okay, i now see a download field in the product admin.

I'm sure I'll be back with more questions.

John Nolan
Advanced Member

Canada
406 Posts

Posted - 09/29/2020 :  06:49:02  
Hmm...I think I'm almost there getting digital downloads working. I've got a test file for download here:
https://www.ragandbone.ca/boxoffice/etickets/test.pdf

and I've entered the same thing,
http://www.ragandbone.ca/boxoffice/etickets/test.pdf
into the download field in product admin

My question is:
I want to move the "etickets" folder out of the public area of my website, but I don't know how to write that url.

My site resides at https://www.ragandbone.ca/boxoffice/, and I have public files at https://www.ragandbone.ca.
I can create folder a folder named "etickets" above www.ragandbone.ca and populate it, but I don't know how to address it.

I tried using the parameter:
$digidownloadmethod="filesystem";
with the link http://www.ragandbone.ca/boxoffice/etickets/test.pdf
and it called up an error page, so I remove the filesystem parameter.







Edited by - John Nolan on 09/29/2020 07:37:40

Phil
ECT Moderator

United Kingdom
7622 Posts

Posted - 09/29/2020 :  08:24:49  
Hi John,
First of all zip up your pdf file and make sure the zip file is the same name as your product reference for that product.

So if your product reference is test the zip file in your etickets folder must be named test.zip and enter A in the download field for that product

Then add the following to your includes.php file

$digidownloadwarn=TRUE;
$digidownloadpattern="\home\etickets\%pid%.zip"; // the path will be something like this - read below
$digidownloadmethod="filesystem";
$digidownloadsecret="fe2ls2pl2jJbIONowk234ksdf"; // replacing 'fe2ls2pl2jJbIONowk234ksdf' with your own random characters
$digidownloademail="Your products can be downloaded for the next 3 days by going to the URL%nl%http://www.ragandbone.ca/boxoffice/latedownload.php?ordid=%orderid%&pass=%password%%nl%Or alternatively, go to the URL%nl%http://www.ragandbone.ca/boxoffice/latedownload.php%nl%. . . and enter the order ID %orderid% and password %password%%nl%%nl%";
$digidownloaddays=10; //Setting this will make downloads available for the number of days specified. The default is 3 days
and the example above would set it to 10


Open the file thanks.php in HTML / code view and search for the line . . .

<?php include "vsadmin/inc/incthanks.php" ?>

. . . and on the line after that add . . .

<?php include "vsadmin/inc/digidownload.php" ?>


To get the path to your etickets directory which needs to be outside root make a file called t.php in a text editor with the following code

<html><body><?php
echo getcwd();
?></body></html>

upload that to your web root and open it in your browser. That will give you the path to the web root from which you should be able to work out the path to your etickets folder you've set up. Paste the correct path into $digidownloadpattern

That should be it really, if the path is correct and your zip file matched the product reference you should be able to download the file from the thanks.php page





* Database Migrations and Conversions*
* ASP to PHP Cart Conversions*

*Contact Us*
*Buy The PHP Capture Card Plugin*
*Rate Our Services/View Our Feedback*

Edited by - Phil on 09/29/2020 08:29:02

John Nolan
Advanced Member

Canada
406 Posts

Posted - 09/29/2020 :  08:49:59  
Thanks Phil, I think I've more or less go it now.

I haven't used the download pattern path parameter, I'm just pasting into the download field. (Am I missing something? It seems like matching the file name to the pid is just as much trouble as pasting the file name into the download field)

But, yes, activating the filesystem parameter, and using the path given by t.php in the download field, the download works.

I didn't zip my pdf, and it still seemed to work. Why is zipping recommended?

Again, thanks very much for your help.

Phil
ECT Moderator

United Kingdom
7622 Posts

Posted - 09/29/2020 :  09:49:07  
Hi John,

Using the parameter $digidownloadmethod="filesystem"; allows you to just enter A in the download field if the file is named by the product ID, so I would say that's easier and also there's no chance of duplicates and the relationship between product and download file is clear to see.

I suggested you zip the files because most browsers try to open a PDF file rather than download it.

If you're simply pasting the download path into the download field per product you wouldn't need most of the parameters I posted earlier, and if the directory is above root I'm surprised it functions.

I'd recommend you follow my instructions even though you have it working



* Database Migrations and Conversions*
* ASP to PHP Cart Conversions*

*Contact Us*
*Buy The PHP Capture Card Plugin*
*Rate Our Services/View Our Feedback*

Edited by - Phil on 09/29/2020 09:51:27

John Nolan
Advanced Member

Canada
406 Posts

Posted - 09/29/2020 :  10:03:49  
Hi Phil:
I was pasting "/home/" plus my username plus "//etickets/test.pdf" and it worked. Just lucky?

Okay, I see how opening rather than downloading would be problematic. Chrome on my Mac downloaded, but I didn't test with anything else. Thanks for the heads up.

I see the advantages of the product ID method. I was just worried because I have my product IDs synthesized from the performance date and times, so they are things like "sn20_09_27-3:30" for a performance of "Snippets" on September 20, 2020 at 3:30. I thought that might result in unworkable filenames. But I haven't tried it yet. I was trying to keep it as simple as possible, since ,yesterday, user error meant I couldn't get things working at all.

The product ids are also used in a Filemaker database that I use for accounting, contact management and the like, so I'm loath to mess with them.

Edited by - John Nolan on 09/29/2020 10:08:11

Phil
ECT Moderator

United Kingdom
7622 Posts

Posted - 09/29/2020 :  10:13:25  
Hi John,
I see your point there with the file names so I don't see any problem with your set up if it works for you

Just glad you have it functioning and the main thing is the download files are outside the root directory



* Database Migrations and Conversions*
* ASP to PHP Cart Conversions*

*Contact Us*
*Buy The PHP Capture Card Plugin*
*Rate Our Services/View Our Feedback*

John Nolan
Advanced Member

Canada
406 Posts

Posted - 09/29/2020 :  10:17:05  
Thanks again Phil.
  « Topic »  
Jump To:
Shopping Cart Software Forum for Ecommerce Templates © 2002-2022 ecommercetemplates.com
This page was generated in 0.03 seconds. Snitz Forums 2000