Forums / General Questions / Download by redirect and number of downloads allowed problems

Download by redirect and number of downloads allowed problems

Started by danaclaire on 8 Apr 2011, 8:22 PM · Views: 1,428

Results 1 to 13 of 13
8 Apr 2011, 8:22 PM
#1
danaclaire avatar

danaclaire

New Zenner

Join Date:
Jan 2008
Posts:
17
Plugin Contributions:
0

Download by redirect and number of downloads allowed problems

The first problem -- I'm trying to set up downloading and have attributes set to download by redirect (set to true). I checked on my server and the "PUB" file has permissions set to 777.

I tested this feature, and was able to bookmark and re-access the downloadable file numerous times. Then I did another test order. After that I was not able to access the first one (temp file in PUB folder was gone) but could access the second one over and over again by bookmarking the link I got to when I clicked on the download link in the order confirmation email. There's now a new temp folder in the PUB folder containing the second test order product file, which again didn't go away after the first download was done.

I was under the impression that the temp folder containing the downloadable file would go away after the download, but that doesn't seem to be the case here. It apparently only disappears when there's a new temp file created (which in our case might not happen for days).

My second problem -- I have the number of downloads allowed set to 1. That is reflected on the order information page containing the download button. However, the download button was still there after one download, and I was still able to to the download twice before the download link went away.

I'm using v. 1.3.9 and my server is Blue Host (Linux).

I'm somewhat of a novice user. Hopefully I'm just missing something obvious here.
Thanks.

8 Apr 2011, 9:12 PM
#2
jsweb avatar

jsweb

Zen Follower

Join Date:
Jul 2005
Location:
UK and Ireland
Posts:
392
Plugin Contributions:
0

Re: Download by redirect and number of downloads allowed problems

Hi there

It seems you are nearly there; can I advice you to revisit the tutorials at https://www.zen-cart.com/tutorials/index.php and type in DOWNLOAD as your search. There are a number of really useful tutorial posts about downloads which will explain the setup in full.

Let us know how you get on.

The JSWeb Team
Providing Zen Cart Hosting, Design and Support services to help your business succeed online!
JSWeb | UK / Ireland ZenCart Design and Hosting Specialists

8 Apr 2011, 10:01 PM
#3
danaclaire avatar

danaclaire

New Zenner

Join Date:
Jan 2008
Posts:
17
Plugin Contributions:
0

Re: Download by redirect and number of downloads allowed problems

Hi-
Thanks for your reply. I did as you suggested (search "downloads") and the only relevant link I found was one I already saw. In that article (relating to file downloads) it states (relating to the download by redirect attribute):

"This means the customer can only ever access it via that stub, which disappears after their download is over. It hides the "real" location of the file so they can't just share the download link with their friends and have them steal your downloads for free."

However, it appears that the temp folder holding the file name of the file to be downloaded does not go away as soon as it's downloaded. It apparently stays there until there's a new one created (by another order placed creating another temp folder containing the subsequent order download). So, even though the tutorial states that the "stub" disappears after the file is downloaded, it seems that it does not (at least with my current settings).

Again, hopefully I'm missing something. . .

12 Apr 2011, 12:41 PM
#4
jsweb avatar

jsweb

Zen Follower

Join Date:
Jul 2005
Location:
UK and Ireland
Posts:
392
Plugin Contributions:
0

Re: Download by redirect and number of downloads allowed problems

I'm out of the office today so just on a mobile device.

If I recall correctly log into your Admin > Catalog > Downloads Manager

There you will see the available downloads and days/counter. e.g.

Filename: helloworld.zip
Max Days: 7
Max Downloads: 5

Thus allowing that download to be AVAILABLE for x days or x downloads.

Check to see what you have set your downloads to be.

The JSWeb Team
Providing Zen Cart Hosting, Design and Support services to help your business succeed online!
JSWeb | UK / Ireland ZenCart Design and Hosting Specialists

12 Apr 2011, 2:50 PM
#5
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Re: Download by redirect and number of downloads allowed problems

While the Download count is set to 1, when the download is made the screen is not refreshed so it "appears" to still have 1 left ... if another attempt is made for the download it will not work as the previous download has used up the 1 download ... and you should get the download expired screen ...

The download temporary directories will be cleaned up on the next download made by anyone with an order with downloads ...

Linda McGrath
If you have to think ... you haven't been zenned ...

**Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!**

Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today!]
Officially PayPal-Certified! Just click here

Try our Zen Cart Recommended Services - Hosting, Payment and more ...
Signup for our Announcements Forums to stay up to date on important changes and updates!

12 Apr 2011, 4:34 PM
#6
danaclaire avatar

danaclaire

New Zenner

Join Date:
Jan 2008
Posts:
17
Plugin Contributions:
0

Re: Download by redirect and number of downloads allowed problems

Thanks so much for the replies.

Regarding the first problem: I posted the question (about the temp file staying in the PUB folder until another one is created) in another topic as well as here and was told by DrByte that this is a problem which will be fixed in version 1.5. The suggestion was to change to download by streaming, so I'll test that.

Regarding the number of downloads allowed: I figured out that I had to set that attribute for each product. When I did that, it worked.

Thanks again.
Dana

12 Apr 2011, 4:56 PM
#7
yolanda avatar

yolanda

Zen Follower

Join Date:
Jul 2009
Posts:
101
Plugin Contributions:
0

Re: Download by redirect and number of downloads allowed problems

This is interesting! I am working on a download store right now for mp3s. Just want to understand this correctly. If I set the max number of days/downloads then the customer cannot download after those expire, no matter if page is bookmarked or no one has made another download correct? The file will NOT be available after said days/tries. Just want to be absolutely sure.

And what will be fixed in 1.5? Cleaning of the pub folder? So.. can I still use re-direct without any effect on how many times someone can download one file?

Also.. what are you using for audio previews if you deal in audio that is. I'm asking this in another thread and haven't gotten any replies yet.

But definitely need clarification on this download thing.
Yolanda

12 Apr 2011, 6:07 PM
#8
danaclaire avatar

danaclaire

New Zenner

Join Date:
Jan 2008
Posts:
17
Plugin Contributions:
0

Re: Download by redirect and number of downloads allowed problems

The way it is working for me is that with Redirect the download link goes to the file which is in a temp folder in the PUB folder. My product files are PDFs. The link opens the PDF and a person has to save the file. Once the download link has been accessed the number of times allowed, the download link is no longer available.

However, if I bookmark the link accessed from the download link, I can access that link until another purchase is made, creating another temp folder in the PUB folder. I have one link bookmarked which has been there for several days. I can still access it. I don't think the time restriction attribute has any affect on this.

Here's what I was told in response to this question under another topic:

"Yes, it's a known design flaw inherited from oscommerce.

"We've fixed it in the upcoming v1.5.0 version by introducing a scheduled garbage-collection process.

"In the meantime if your customers are the type who are prone to share, then change to Download By Streaming instead of Download by Redirect. That way they'll never get a link at all. " (DrByte)

Dana

12 Apr 2011, 6:38 PM
#9
yolanda avatar

yolanda

Zen Follower

Join Date:
Jul 2009
Posts:
101
Plugin Contributions:
0

Re: Download by redirect and number of downloads allowed problems

Thank you for your detailed explanation. Man... that does not sound good. I had no idea that this was happening. What about cleaning out the pub folder manually? I don't know.. is Zen-Cart a viable cart for downloads? I'm starting to wonder about this. What does streaming entail? Can they still save a file that way? They are paying for an mp3 that they would like to keep.... not just listen to once or twice....

Will they be able to get an mp3 FILE by streaming this?

12 Apr 2011, 11:55 PM
#10
danaclaire avatar

danaclaire

New Zenner

Join Date:
Jan 2008
Posts:
17
Plugin Contributions:
0

Re: Download by redirect and number of downloads allowed problems

You're welcome. I'm by no means an expert. I read about how the download by streaming option works in the online documentation. Here's what it says:

Download by streaming only works when Download by Redirect is off. Instead of giving the customer a URL to the file, Zen Cart sends the file as a download, in 2KB chunks. This helps with server RAM load as well as completely preventing any download link from ever being shared with your customers.
This option works on both Windows and Linux hosts.
There is one limitation with this method ... your server's PHP configuration for max_execution_time needs to be set to a value large enough for your largest file to complete its download, or at least configured in such a way that Zen Cart is allowed to override it. Zen Cart attempts to set it to unlimited when the download starts, but if your server won't allow that, it'll default to the server's master setting ... which is often 30 seconds.

Apparently with streaming, saving is all you can do since you never get a link. I haven't tested this yet - planning to do it tonight. It sounds like it should solve my problem. Our files are up to 1.5 meg so hopefully it will work OK.

Good luck on yours.
Dana

12 Apr 2011, 11:59 PM
#11
danaclaire avatar

danaclaire

New Zenner

Join Date:
Jan 2008
Posts:
17
Plugin Contributions:
0

Re: Download by redirect and number of downloads allowed problems

Also -- you can certainly go into the pub folder and manually delete the temporary folder that's created with a purchase, but I sure wouldn't want to have to do that every time someone buys something.

Hopefully streaming will work, and also, hopefully, version 1.5 will be ready in the not-too-far-distant future. Since this software is free, I imagine the developers are doing the best that they can.
Dana

13 Apr 2011, 2:16 AM
#12
yolanda avatar

yolanda

Zen Follower

Join Date:
Jul 2009
Posts:
101
Plugin Contributions:
0

Re: Download by redirect and number of downloads allowed problems

Thank you so much Dana. Much appreciated. I'll look into streaming as well. I do have control over the server so I could set this parameter in php I guess. My files will be anywhere from 5 to 15mbs..

And yes of course. I so appreciate having Zen Cart as an open source vehicle. I actually built a cart for a company and they loved it. Not any downloading however so this is all new for me.

Best in your endeavors and much gratitude.
Yolanda

14 Apr 2011, 8:14 AM
#13
jsweb avatar

jsweb

Zen Follower

Join Date:
Jul 2005
Location:
UK and Ireland
Posts:
392
Plugin Contributions:
0

Re: Download by redirect and number of downloads allowed problems

It would sure help if the "Download delivery methods explained" article ( https://www.zen-cart.com/tutorials/index.php?article=292 ) was updated to help explain the full download process in more detail.

The JSWeb Team
Providing Zen Cart Hosting, Design and Support services to help your business succeed online!
JSWeb | UK / Ireland ZenCart Design and Hosting Specialists