Page 1 of 1

Error when using large files and download restrictions

PostPosted: September 25th, 2010, 1:34 pm
by mackey
Using latest Wordpress/s2member Pro...

I host large movie files (Usually under 600mb) to subscribers and want to take advantage of the download restrictions.

An example URL is: http://xxxxxxx.com/?s2member_file_downl ... lehere.mp4

It works fine when I use zip files and works great when I tried a file around 50mb, but when I put a larger file in there I get this error:

Fatal error: Allowed memory size of 268435456 bytes exhausted (tried to allocate 614318081 bytes) in /home/xxxxxx/public_html/wp-content/plugins/s2member/includes/functions/file-download-access.inc.php on line 268

I contacted our host who upped the php memory limit but when that didn't work, they suggest to contact you. Please tell me there's a way to fix this. :D Thanks

Re: Error when using large files and download restrictions

PostPosted: September 25th, 2010, 10:34 pm
by drbyte
it will always be limited.....there is no way around your request at this moment.

Even if you got it to work, your host will shut you down within days. You need to move to a dedicated server or host your files somewhere else.

A quick and dirty solution would be like what every body else is doing...Split your files.... not larger than 100MB...add each file link to separate pages full of Google ad ads.......it pays good.. ;)

Sam

Re: Error when using large files and download restrictions

PostPosted: October 19th, 2010, 11:12 am
by ryannagy
I'm curious if you ever found a solution. I'm about to add:

allow_url_include = on
memory_limit=128M
upload_max_filesize=64M
post_max_size=32m

to my php.ini so that I can upload some large mp3's. Eventually, I will need files sizes of about 250mb for some video files. I hope that it doesn't end up being a problem. I suppose large video files could be hosted on Amazon S3. The cost is rather low.

cheers - Ryan

Re: Error when using large files and download restrictions

PostPosted: October 22nd, 2010, 5:45 am
by Jason Caldwell
Hi Ryan. If you're on a dedicated server, it's NOT a problem.
See: viewtopic.php?f=4&t=423&p=1879&hilit=large+file+downloads#p1879

If you're on a shared hosting platform, you WILL have trouble with very large files. There is no work-around for this yet, but we ARE working toward a long-term solution for a future release of s2Member.

Re: Error when using large files and download restrictions

PostPosted: October 22nd, 2010, 10:20 pm
by drbyte
Hi Guys,

Actually there is. Here are the steps:

1. Inline File Extensions ( optional, for content-disposition )

Add the file extension to the list. One file only. In my case I added .mp4

2. save

3. add this code to your template or create a Custom fields

Code: Select all
<a title="Pro" href="http://www.site.com/?s2member_file_download=sample.mp4">Download Movie - Right Click and Save As</a>



For custom filed add this:

Code: Select all
<?php echo get_post_meta($post->ID, download, true); ?>


download can be anything...that's just an example

4. Go to your post and Custom Filed------>Enter new-----> enter download (lower case only)

5. add this code to either, save
Code: Select all
<a title="Pro" href="http://www.site.com/?s2member_file_download=sample.mp4">Download Movie - Right Click and Save As</a>


Now, in Firefox, you have to right click and save link as. for IE click on the link and it will save the movie, in Google Chrome, click and it will save the movie.

Hope that helps

Sam