PriMoThemes — now s2Member® (official notice)

This is now a very OLD forum system. It's in READ-ONLY mode.
All community interaction now occurs at WP Sharks™. See: new forums @ WP Sharks™

Protected zip files are modified/broken when downloaded

s2Member Plugin. A Membership plugin for WordPress®.

Protected zip files are modified/broken when downloaded

Postby BoweFrankema » April 5th, 2011, 5:54 am

Hi Guys,

I've been using S2Member for almost a year now for my premium theme business, and it's been a great experience overall. Everything was running smoothly on my setup, until I upgraded WordPress and S2Member to their latest versions. Since then my protected zip files have been impossible to open for my customers.

Here's my setup:

I have one membership level with custom capabilities added to them. When a member purchases a Theme he become S2Member LVL1 with the custom capability of the theme name. He is then able to download the zip file with the theme in it. My protected downloads are setup properly:

Code: Select all
plugin/s2member-files/ccap-mytheme/my-theme.zip


When I download this file directly from my server everything is cool. No problems. As soon as I start using the special S2Member link:

Code: Select all
?s2member_file_download=access-s2member-ccap-mytheme/my-theme.zip


The file somehow get's modified or messed up.

As soon as you try to open the file the following error occurs on Windows:

"Error opening file: Invalid folder."

On MAC OSX it works for a few people but a new folder is created with dummy files in it (called _MacOSX)

So my first idea was that I packaged the zip files wrong. But this is not the case, since if I move the zip file outside of the s2member-files folder, and removing the .htaccess protection, the opens up fine for everyone. So the problem seems to be related to the file protection/.htaccess somehow modifying the zip when being downloaded.

For now this means I need to manually send people their themes, but I really need a solution for this. It's a pretty advanced problem, but it was working just fine in the past :-)

Greetings,
Bowe
User avatar
BoweFrankema
Registered User
Registered User
 
Posts: 11
Joined: August 24, 2010

Re: Protected zip files are modified/broken when downloaded

Postby BoweFrankema » April 6th, 2011, 5:33 am

Hi guys,

Is there anything I can do? This is pretty much killing my entire custom S2Member integration :|
User avatar
BoweFrankema
Registered User
Registered User
 
Posts: 11
Joined: August 24, 2010

Re: Protected zip files are modified/broken when downloaded

Postby drbyte » April 6th, 2011, 10:03 am

Hi

You must be using FireFox!

Try Google Chrome and see if you still have the same problem


Sam
User avatar
drbyte
Experienced User
Experienced User
 
Posts: 269
Joined: May 6, 2010

Re: Protected zip files are modified/broken when downloaded

Postby Jason Caldwell » April 7th, 2011, 11:55 am

Hi Bowe. Great to hear from you.

Thanks for reporting this important issue.
It sounds to me like this could be a server-specific issue, possibly related to s2Member's updated handling of chunked file delivery. Perhaps it's not working with your server configuration.

For a possible quick-fix, I would try this.

Create this directory and file:
/wp-content/mu-plugins/s2-hacks.php
Code: Select all
<?php
add_filter
("ws_plugin__s2member_stream_file_downloads", "__return_false");
?>

Please see if that makes the problem go away. If it does, then please provide me with the following details so we can make an attempt to reproduce this problem on our end. 95% of the work in fixing bugs like this, is finding a way to reproduce it.

1. Operating system, Windows or Unix?
2. What exact version of PHP are you running?
3. Who is your hosting company?
4. What version of WordPress?
5. What version of s2Member?
~ Jason Caldwell / Lead Developer
& Zeitgeist Movie Advocate: http://www.zeitgeistmovie.com/

Is the s2Member plugin working for you? Please rate s2Member at WordPress.org.
You'll need a WordPress.org account ( comes in handy ). Then rate s2Member here Image
.
User avatar
Jason Caldwell
Lead Developer
Lead Developer
 
Posts: 4045
Joined: May 3, 2010
Location: Georgia / USA

Re: Protected zip files are modified/broken when downloaded

Postby BoweFrankema » April 7th, 2011, 2:05 pm

Hi Jason,

That indeed fixed the problem! Thanks!

Here's a detailled report of my server setup to help you pinpoint the cause of this issue (hopefully):

Cloud VPS (Linux) - 2048MB
Operating System: CentOS 5.5 x64
APC Version 3.1.6
PHP Version 5.2.17
WordPress 3.1.1
BuddyPress 1.2.8
S2Member Version 3.5.7

Also using an external service called CloudFlare.com for CDN and security stuff. I contacted them for know issues with zip files, but they said it should not be cause to my problem. Moving the zip files to any other folder solves the problem. Reinstalling S2Member is an option, but since it took me quite a while to get it running, I'd rather not do that :-)

If you need anything else just let me know!
User avatar
BoweFrankema
Registered User
Registered User
 
Posts: 11
Joined: August 24, 2010

Re: Protected zip files are modified/broken when downloaded

Postby Jason Caldwell » April 7th, 2011, 7:38 pm

Thank you Bowe. So is CloudFlare.com hosting these protected files? If so, how did you go about integrating them with your site? Specifically, how did you get s2Member to pull your protected files from CloudFlare.com?
~ Jason Caldwell / Lead Developer
& Zeitgeist Movie Advocate: http://www.zeitgeistmovie.com/

Is the s2Member plugin working for you? Please rate s2Member at WordPress.org.
You'll need a WordPress.org account ( comes in handy ). Then rate s2Member here Image
.
User avatar
Jason Caldwell
Lead Developer
Lead Developer
 
Posts: 4045
Joined: May 3, 2010
Location: Georgia / USA


Return to s2Member Plugin

Who is online

Users browsing this forum: No registered users and 1 guest

cron