Zen Cart Logo
If this is your first visit, check our documentation. To post, register or login.
Forums / Setting Up Your Zen Cart Products / Setting Up Categories, Products, Attributes / Setting downloads to 7 day expiration with unlimited downloads

Setting downloads to 7 day expiration with unlimited downloads

Locked

Started by chestnut_junction on 22 Oct 2009, 7:23 AM · Views: 5,399

Results 1 to 20 of 39
This thread is locked. New replies are disabled.
22 Oct 2009, 7:23 AM
#1
chestnut_junction avatar

chestnut_junction

New Zenner

Join Date:
Aug 2009
Posts:
35
Plugin Contributions:
0

Post #1 by chestnut_junction

Hello!

I am in the final phase of finally getting my site up and running and have a question in regards to downloads. I wish to have an unlimited amount of downloads available to customers with an expiration of 7 days per download. Here is my concern, I have concluded that the only way to have unlimited downloads is to set the number to an unreachable limit such as 99,999 and setting the expiration to 7 days, but I do not want the 99,999 figure to show up in the checkout process. I have found the controller "define('TABLE_HEADING_DOWNLOAD_COUNT', 'Remaining')" and my intent is to disable this altogether so it no longer shows in the download process, my question being, how/where do I turn this item off??? Another option would be if there were a way to actually set the download count to "unlimited", either option would accomplish the task :D

My site it https://www.epatternjunction.com and it is not live yet, so only the check/money order option of payment is enabled.

Thank you in advance for any help!
~Chestnut Junction

23 Oct 2009, 1:18 AM
#2
ajeh avatar

ajeh

Oba-san

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

Post #2 by ajeh

And if you customized the tpl_modiues_download.php around:

      <td class="centeredContent"><?php echo ($downloads->fields['download_maxdays'] == 0 ? TEXT_DOWNLOADS_UNLIMITED_COUNT : $downloads->fields['download_count']); ?></td>

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!

23 Oct 2009, 1:19 AM
#3
ajeh avatar

ajeh

Oba-san

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

Post #3 by ajeh

NOTE: still set it ridiculously high, just don't show it ... :smile:

NOTE: using your templates and overrides, of course ... :cool:

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!

23 Oct 2009, 4:17 AM
#4
chestnut_junction avatar

chestnut_junction

New Zenner

Join Date:
Aug 2009
Posts:
35
Plugin Contributions:
0

Post #4 by chestnut_junction

Thank you sooo much for your help Ajeh, I'm off to edit it now :laugh:

23 Oct 2009, 5:00 AM
#5
chestnut_junction avatar

chestnut_junction

New Zenner

Join Date:
Aug 2009
Posts:
35
Plugin Contributions:
0

Post #5 by chestnut_junction

Ok, I have found the line to edit in the tpl.modules.download.php, now, newbie question, how do I edit it to either turn off or set the Download quantity to unlimited lol!

Thanks for any help!
~Chris

23 Oct 2009, 6:26 AM
#6
chestnut_junction avatar

chestnut_junction

New Zenner

Join Date:
Aug 2009
Posts:
35
Plugin Contributions:
0

Post #6 by chestnut_junction

Ok, I managed to get the remaining download count to vanish, but now I have a very frustrating and unresolved problem. My files are instant download .pdf patterns and every time I try to download the .pdf it comes across as being corrupt and cannot be opened. I have read several forum posts in regards to corrupt files and have tried several resolutions to solve this problem. I have renamed my files to eliminate any characters that may be bad and I have also zipped my pdfs then tried to download. When I download the zip then try to unpack it, they say that they are empty and will fail to unzip. The really odd part is that if I clear my internet properties then retry the zip download, it downloads fine and even unzips without a problem, but I do not think my customers will wish to go through the trouble of doing this, and furthermore, I would really like them to be able to download the pdfs directly without zipping them. Any help would be GREATLY appreciated!

Chris Sharp
https://www.epatternjunction.com

23 Oct 2009, 4:55 PM
#7
ajeh avatar

ajeh

Oba-san

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

Post #7 by ajeh

What happens if you turn off the Redirect on the Attributes? Configuration ... Attribute Settings ...

Download by Redirect
Use browser redirection for download. Disable on non-Unix systems.

Note: Set /pub to 777 when redirect is true

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!

24 Oct 2009, 12:54 AM
#8
chestnut_junction avatar

chestnut_junction

New Zenner

Join Date:
Aug 2009
Posts:
35
Plugin Contributions:
0

Post #8 by chestnut_junction

I have download by redirect off and the permissions on my Pub folder set to 777 as per a previous thread and still have the corrupt pdf/empty zip problem :shocking: Question though, the servers I am hosted on are linux/unix therefor, should'nt the download by redirect work? Another question, could this be a shared server problem that may be fixed by moving to a dedicated server? I have tried a number of fixes but the problem still periodically happens. I can attempt it once and find the pdf corrupt, but turn around and try again only to have it be perfectly fine, but then I try again, and corrupt again :no: It is very frustrating seeing as how this is one of the last hurdles to overcome before going live with my site.

Thanks for any help!
~Chris
https://www.epatternjunction.com

24 Oct 2009, 2:25 AM
#9
ajeh avatar

ajeh

Oba-san

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

Post #9 by ajeh

There Redirect will work if it is setup correctly by your hosting provider to work with the symbolic link ... the .htaccess file contains in:
/includes/pub/.htaccess

#prevent directory browsing -- for security
IndexIgnore */*

  Options +FollowSymLinks -Indexes

You would need to talk to your hosting provider to see what the problem is ...

Also check what the size of the file limit size is for your site ...

Test this by making a tiny zip, such as the test.php zip that comes with Zen Cart to see if there is a problem with size ...

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!

24 Oct 2009, 4:47 AM
#10
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,512
Plugin Contributions:
176

Post #10 by drbyte

Chestnut Junction:

My files are instant download .pdf patterns and every time I try to download the .pdf it comes across as being corrupt and cannot be opened.every time?
You're contradicting yourself:
Chestnut Junction:

The really odd part is that if I clear my internet properties then retry the zip download, it downloads fine and even unzips without a problem
and also:> Chestnut Junction:

I have tried a number of fixes but the problem still periodically happens. I can attempt it once and find the pdf corrupt, but turn around and try again only to have it be perfectly fine
So, you're saying it's not EVERY time, right?

You even started another discussion in another thread saying:> Chestnut Junction:

The issue is that 90% of the pdf downloads I test will come through as corrupt

Chestnut Junction:

I have read several forum posts in regards to corrupt files and have tried several resolutions to solve this problem. I have renamed my files to eliminate any characters that may be bad and I have also zipped my pdfs then tried to download.Those can be helpful steps to take.
Chestnut Junction:

When I download the zip then try to unpack it, they say that they are empty and will fail to unzip.ARE the files empty? How many bytes is the zip file after downloading?
How many bytes was it before downloading? ie: on the server
Chestnut Junction:

I have download by redirect off and the permissions on my Pub folder set to 777 as per a previous thread and still have the corrupt pdf/empty zip problem777 permissions won't necessarily fix a corruption problem. It may help if files won't download at all, but usually is unrelated to corrupt content.> Chestnut Junction:

Question though, the servers I am hosted on are linux/unix therefor, should'nt the download by redirect work?Your question suggests that the download-by-redirect doesn't work. What exactly do you mean by that? Is there a particular symptom?
How do you know it doesn't work? Maybe it does. If it didn't, it would be telling you the download couldn't be offered.
A corrupt file doesn't mean the symlink required for the redirect can't be created.
A corrupt file merely means that what you received on your PC wasn't what you were expecting to receive vs the original file.> Chestnut Junction:

Another question, could this be a shared server problem that may be fixed by moving to a dedicated server?Maybe. Maybe not.

.
Zen Cart - putting the dream of business ownership within reach of anyone!
Donate to: DrByte directly or to the Zen Cart team as a whole

Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

24 Oct 2009, 4:49 AM
#11
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,512
Plugin Contributions:
176

Post #11 by drbyte

Chestnut Junction:

My question at this point is ... if someone could explain in more detail how I would go about editing the php.ini file on my server (even though it is a shared server) to a setting that will not time out on download.
You haven't given any indication how big these files are. Are they 50KB? Are they 2 MB? Are they 5000 MB?
Nor have you indicated how busy the site is? How often are people downloading simultaneously?

There's a "max_execution_time" setting in php.ini that you can change if you have sufficient control over it on your server. You'll have to ask your hosting company for the correct way to alter that on your specific server, since the process varies from server to server, and in some cases is disallowed by the server admin's choices.

Chestnut Junction:

Also, I am on a unix/linux server therefor, download by redirect should work, but each time I use this setting, I get a 404 forbidden message even with Pub set to 777???
I'm guessing that this quote, taken from a post you made in another thread, is part of the answer to an incomplete statement you made here in this thread. Please try to keep your details together, rather than scattered. It really helps give better answers when your details are in one place.

A 404 message is a "not found" message. A 403 message is a "forbidden" message.
So ... which is it? Are you getting 404? or 403?
A setting of 777 on the pub folder has no relation to either error.
Setting the pub folder to 777 simply allows a symlink to be created there. And then that symlink is what the browser is sent to. Zen Cart is smart enough to know that the symlink was created successfully before doing the redirect. If the symlink didn't get created properly, Zen Cart automatically changes its method to something else.
Either way, a 404 would only happen if the browser was directed to a file that doesn't exist, or to a symlink that is broken or deleted.
And a 403-forbidden would only happen if you've got .htaccess restrictions set up to prohibit the download of files from that folder.
Your server's apache errorlog will tell you the cause of 403 and 404 errors.

.
Zen Cart - putting the dream of business ownership within reach of anyone!
Donate to: DrByte directly or to the Zen Cart team as a whole

Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

24 Oct 2009, 4:53 AM
#12
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,512
Plugin Contributions:
176

Post #12 by drbyte

Chestnut Junction:

I have tried streaming, and changing redirect AND streaming to false and still have corrupt pdfs.
There are 3 possible methods:

  • redirect (requires symlink capability, then handled directly by apache)
  • streaming (requires sufficient PHP memory limit and execution time)
  • direct (handled strictly by apache)

If "direct" (streaming off and redirect off) doesn't work, then your problem is either with your server/apache configuration or with your pc/browser.

There's no point trying the other approaches if the direct method doesn't work, as the others are merely alternatives which offer greater security to prevent theft and sometimes improve performance. But the alternatives are pointless if the basic direct download won't work.

.
Zen Cart - putting the dream of business ownership within reach of anyone!
Donate to: DrByte directly or to the Zen Cart team as a whole

Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

25 Oct 2009, 5:36 AM
#13
chestnut_junction avatar

chestnut_junction

New Zenner

Join Date:
Aug 2009
Posts:
35
Plugin Contributions:
0

Post #13 by chestnut_junction

Firstly, thank you to both Ajeh and Dr. Byte for your replies! I will try to sum up the problems I have encountered, and forgive the late responses, my work schedule is both abnormal and all-consuming :shocking:

  1. The pdf patterns I sell are between 600-800kb in size, zipped they are between 400-500kb (using the default zip program in Win Vista).

  2. The download options:

~Direct Download (false on both stream and redirect): The pdf will "Open" and "Save", but they will show as "corrupted" 50% of the time. I have had luck with cleaning out my temp. internet files then retrying the download and having the download not be corrupt, but if I try the download a second time (without cleaning the internet files) it will be corrupt again on both "open" and "save". Zip files will download as 0mb even though they are fine on the server as if the pdf in them is no longer there.

~Download by Stream (false on redirect, true on stream, Pub set to 777): The same issues as above, random corruption. I have re-uploaded several pdfs (in binary form) and tried again, but still receive corrupt files and empty zips and random times.

~Download by Redirect (the method I would like to use): I recieve the following error

"Forbidden
You don't have permission to access /pub/.tgrfixodbnlpbievhxk/ on this server.

Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request.


Apache/2.2.11 (Unix) mod_ssl/2.2.11 OpenSSL/0.9.8i DAV/2 mod_auth_passthrough/2.1 mod_bwlimited/1.4 FrontPage/5.0.2.2635 Server at epatternjunction.com Port 80"

I consulted my host service (Hostgator) via live chat and they informed me that Symlink by default is active...here is a link to the specifics of my server:

http://secure2.hostgator.com/phpinfo.php

Now, as a test, I downloaded a file from my pc at work running Win XP, i.e. 7 and the download worked every time on stream. The PCs I have tested at home are all running Vista with internet explorer 8. I had read in an earlier post that finding the source of the corruption is important when dealing with pdf files, but I am not sure how to determine the source of the corruption and at this point, I am inclined to believe that this is a browser/OS issue, and also, my work PC is directly wired to our network via ethernet cable, whereas all of my home PCs run wirelessly from a router, but still DSL. I am trying to find a way to insure a 100 or at least 95% success rate on downloads, so my questions would be (a) is the download by redirect option the most reliable download system and (b) I am currently on a shared server, would moving my site to a dedicated server effect my download problems, as in, without sharing server draw, would my streaming be less likely to be degraded by server performance? In looking through my cpanel I have found a link to the php.ini config system, but several of the options are "grayed out"....

max_execution_time 30
max_input_time 60
memory_limit 64m

are all gray and cannot be changed as well as...

enable_dl
upload_max_filesize 64m

Would a dedicated server give me access to the configs of these areas and in general improve the performance of my site?

Please forgive the wall of text, I am somewhat knowledgable in regards to websites and the construction of such, but server configs are another story. If there is any other information that would be helpful, I will gladly supply it and after work, I plan on making a "dummy" download so that others may test on different operating systems.

THANK YOU so much for your continued help :smile:
~Chris
https://www.epatternjunction.com

25 Oct 2009, 6:07 AM
#14
chestnut_junction avatar

chestnut_junction

New Zenner

Join Date:
Aug 2009
Posts:
35
Plugin Contributions:
0

Post #14 by chestnut_junction

Minor update...I tried a file at work again and it failed with the message "There was an error opening this document. The file is damaged and could not be repaired." I then deleted that download and tried the exact same download (streaming) and it was fine! I viewed the history through adobe and noticed this...my files are named such #e101PatternName, now, the corrupt pdf was listed as _e101PatternName, but the successful download was listed as %23e101PatternName...now I have renamed several files by eliminating the "#" but I still encountered corruption therefor, I wrote it off as not a naming convention error.

Thanks again!
~Chris
https://www.epatternjunction.com

25 Oct 2009, 6:13 AM
#15
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,512
Plugin Contributions:
176

Post #15 by drbyte

Chestnut Junction:

I have had luck with cleaning out my temp. internet files then retrying the download and having the download not be corrupt, but if I try the download a second time (without cleaning the internet files) it will be corrupt again on both "open" and "save".Keep in mind that your customers will not have any cache to clear (related to your site anyway, and that's the issue there), so that should not be a problem for them. Using the redirect method gives a different filename for the actual download each time anyway (until after the download is completed), so getting that working will minimize the cache problem.
Chestnut Junction:

Zip files will download as 0mb even though they are fine on the server as if the pdf in them is no longer there.That sounds very odd, but I'm inclined to think zipping is not necessary, and, as you stated earlier, undesirable anyway.
Chestnut Junction:

~Download by Redirect (the method I would like to use): I recieve the following error

"Forbidden
You don't have permission to access /pub/.tgrfixodbnlpbievhxk/ on this server.What's in your /.htaccess and /pub/.htaccess files?
What's the server's apache errorlog saying when you get those "forbidden" errors?

Chestnut Junction:

so my questions would be (a) is the download by redirect option the most reliable download systemYes, redirect is the most desirable for performance and security reasons> Chestnut Junction:

(b) I am currently on a shared server, would moving my site to a dedicated server effect my download problems, as in, without sharing server draw, would my streaming be less likely to be degraded by server performance?Yes and no. Unless you're making a ton of sales with thousands of visitors and buyers each day, with a huge profit margin, you shouldn't need to go dedicated.> Chestnut Junction:

In looking through my cpanel I have found a link to the php.ini config system, but several of the options are "grayed out"....

max_execution_time 30
max_input_time 60
memory_limit 64m

are all gray and cannot be changed as well as...

enable_dl
upload_max_filesize 64mFine.
Chestnut Junction:

Would a dedicated server give me access to the configs of these areas and in general improve the performance of my site?Yes and no.

.
Zen Cart - putting the dream of business ownership within reach of anyone!
Donate to: DrByte directly or to the Zen Cart team as a whole

Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

25 Oct 2009, 6:18 AM
#16
chestnut_junction avatar

chestnut_junction

New Zenner

Join Date:
Aug 2009
Posts:
35
Plugin Contributions:
0

Post #16 by chestnut_junction

Thank you sooo much Dr. Byte! I am currently accessing my cpanel and have opened the "Error Logs" page but it is empty...do I have to enable error tracking?

~Chris
https://www.epatternjunction.com

25 Oct 2009, 6:22 AM
#17
chestnut_junction avatar

chestnut_junction

New Zenner

Join Date:
Aug 2009
Posts:
35
Plugin Contributions:
0

Post #17 by chestnut_junction

Also, I have found an option entitled "Apache Handlers" which allows me to input a "Handler" and an "Extension(s)", but again, please forgive my ignorance in this area :blink:

Thanks you again!
~Chris

25 Oct 2009, 6:24 AM
#18
chestnut_junction avatar

chestnut_junction

New Zenner

Join Date:
Aug 2009
Posts:
35
Plugin Contributions:
0

Post #18 by chestnut_junction

I'm so sorry for all of these replies, I'm free form posting at this point lol! Within my Pub folder I do not have an .htaccess file only an Index.html file, is the .htaccess file perhaps hidden or non-viewable?

a thousand times THANKS!
~Chris

25 Oct 2009, 6:36 AM
#19
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,512
Plugin Contributions:
176

Post #19 by drbyte

Chestnut Junction:

I am currently accessing my cpanel and have opened the "Error Logs" page but it is empty...do I have to enable error tracking?I wouldn't expect so. Ask your host.
Chestnut Junction:

Also, I have found an option entitled "Apache Handlers" which allows me to input a "Handler" and an "Extension(s)", but again, please forgive my ignorance in this areaI don't see this as related.

.
Zen Cart - putting the dream of business ownership within reach of anyone!
Donate to: DrByte directly or to the Zen Cart team as a whole

Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

25 Oct 2009, 6:37 AM
#20
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,512
Plugin Contributions:
176

Post #20 by drbyte

Chestnut Junction:

Within my Pub folder I do not have an .htaccess file only an Index.html file, is the .htaccess file perhaps hidden or non-viewable?
Your FTP program may be set to hide hidden files (ie: files that start with a ".") by default. It should have an option to show hidden files.

.
Zen Cart - putting the dream of business ownership within reach of anyone!
Donate to: DrByte directly or to the Zen Cart team as a whole

Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.