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™

Download corrupt files please help

s2Member Plugin. A Membership plugin for WordPress®.

Download corrupt files please help

Postby lazaros » October 4th, 2011, 10:27 pm

hi first very nice work and very usefull plugin thank you very much for give
i have a problem with s2member and download file always the file is corrupt i use zip file
i try some file like 400 kb,1 mb 3mb for test always same i can't download correct
also i try jpg,mp4,exe for test

i have version s2member 111003 plugin and wordpress 3.21 i use firefox,ie explorer ,google chrome to test and i use os windows 7 i use level 1 or 2 or 3 or 4 for protected my file i try download like amin and (like user level 1) and same problem
the file is corrupt , i try eveything

also when i download the file i can't see the final size

i Upload restricted files to this security-enabled directory:
/blog/wp-content/plugins/s2member-files

why this happend please anyone help me ?



Thank you
User avatar
lazaros
Registered User
Registered User
 
Posts: 3
Joined: October 4, 2011

Re: Download corrupt files please help

Postby Cristián Lávaque » October 5th, 2011, 2:28 am

Lazaros, if you download the file from the server via FTP, is the file OK?
Cristián Lávaque http://s2member.net
Is s2Member working for you? Please rate it Image at WordPress.org. Thanks! :)
User avatar
Cristián Lávaque
Developer
Developer
 
Posts: 6836
Joined: December 22, 2010

Re: Download corrupt files please help

Postby lazaros » October 5th, 2011, 3:38 pm

hi Cristián Lávaque thank you very mush for quick reply

yes for ftp program i try and cpanel work the file fine
only when i try download with link s2member the file is corrupt :( why this happend i need help please

thank you
User avatar
lazaros
Registered User
Registered User
 
Posts: 3
Joined: October 4, 2011

Re: Download corrupt files please help

Postby KezzBracey » October 5th, 2011, 8:06 pm

Hi guys,

I've bumped into the same issue today.

Any zip files in the s2member-files folder are corrupt when downloaded. I've tried two different archiving apps, and Chrome & FF and the result is the same.

They can be opened with 7Zip, but not other apps, and my zips are WP plugins and cause this error when installing through the admin panel: Incompatible Archive. PCLZIP_ERR_BAD_FORMAT (-10) : Invalid archive structure

I've also tried downloading with or without an auth key, and the same result.

The same zips when shifted to another folder download, unzip and install through WP fine.

I followed through this thread which seems to describe much the same scenario: viewtopic.php?f=4&t=6410&p=14925&hilit=corrupt+download

The only difference is my zip is 7k so it's quite small.

I updated s2member with the latest update and no change.

Thanks so much for all your help guys, the plugin is brilliant and you rock!

- Kezz

P.S. As another point of interest, I found if I have a zip with the word "insert" in the filename download access is blocked. :)
User avatar
KezzBracey
Experienced User
Experienced User
 
Posts: 12
Joined: May 31, 2011

Re: Download corrupt files please help

Postby Cristián Lávaque » October 6th, 2011, 3:37 am

Thank you for the kudos, guys! :)

Thanks for all those details, Kezz.

I'm emailing Jason about this.
Cristián Lávaque http://s2member.net
Is s2Member working for you? Please rate it Image at WordPress.org. Thanks! :)
User avatar
Cristián Lávaque
Developer
Developer
 
Posts: 6836
Joined: December 22, 2010

Re: Download corrupt files please help

Postby drbyte » October 6th, 2011, 12:23 pm

HI

Rename your file from something like this sample.zip to sample.zip.txt and try to download it directly by copying the URL link to a new tab.

Please report back

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

Re: Download corrupt files please help

Postby lazaros » October 6th, 2011, 6:13 pm

hi drbyte i know already this doesn't work but i try like you say i rename the file as txt and i download with the
s2member i rename after in zip to unzip and same problem the file is corrupt !
ok i try this i upload image jpg only 16,983 bytes when download with s2member i have 16,996 bytes

if combine the 2 files i use program hex editor

Image

the up is the original the down is download with the s2member
MyPhoto = original file
Myphoto2=is the download s2member

theres is some extras bytes in begin 4257.. i remove this and i save to new file and i can see fine the photo but this no solution....

i hope this help to understand why this happened ?

thank you
User avatar
lazaros
Registered User
Registered User
 
Posts: 3
Joined: October 4, 2011

Re: Download corrupt files please help

Postby KezzBracey » October 6th, 2011, 8:34 pm

drbyte wrote:HI

Rename your file from something like this sample.zip to sample.zip.txt and try to download it directly by copying the URL link to a new tab.

Please report back

Sam


Thanks for your help Sam. :)

I renamed my file to have the extension .zip.txt and downloaded via the direct URL.

The text file itself would open, but when I renamed it back to .zip extension it gave the same corrupt message.

If there's any other info I should provide, let me know.
User avatar
KezzBracey
Experienced User
Experienced User
 
Posts: 12
Joined: May 31, 2011

Re: Download corrupt files please help

Postby KezzBracey » October 8th, 2011, 2:13 am

Hi guys,

Just wanted to drop in and say, happy to pay for your time on this question if it's possible at all to hit you up for some help on this one.

Let me know if I can send you something for your trouble.

Thanks!

- Kezz
User avatar
KezzBracey
Experienced User
Experienced User
 
Posts: 12
Joined: May 31, 2011

Re: Download corrupt files please help

Postby drbyte » October 10th, 2011, 11:39 am

Hi Kezz

Sorry for the late respond.

Are you on a shared hosting account or you have your dedicated server? Is fopen enabled in your php.ini

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

Re: Download corrupt files please help

Postby KezzBracey » October 10th, 2011, 9:44 pm

Hi Sam,

Thanks for your help! :)

The site is currently on a shared host, but I do know that fopen is enabled as I use it in a plugin that works a-okay.

Greatly appreciate anything you could do to shed some light on the subject.

Cheers,

- Kezz
User avatar
KezzBracey
Experienced User
Experienced User
 
Posts: 12
Joined: May 31, 2011

Re: Download corrupt files please help

Postby Jason Caldwell » October 11th, 2011, 5:44 pm

Thanks for bringing this thread to my attention.

If this is still a problem on your installation, please try this and report back.

Create this directory and file:
/wp-content/mu-plugins/s2-hacks.php
Code: Select all
<?php add_filter("ws_plugin__s2member_chunk_file_downloads", "__return_false"); ?>
* Please do NOT introduce any spaces/tabs/line breaks before or after <?php ?>.

This disables s2Member's chunked file delivery, and instead it will use a simple call to file_get_contents(). This works fine for small files, but PHP resource limitations across various platforms require us to chunk the delivery of files to prevent high memory consumption.

On some servers, chunked file delivery may also cause trouble, particularly if your server is configured to perform some form of PHP-based output compression, instead of leaving compression to Apache.

If your server is currently configured with some form of PHP-based output compression, please consider using mod_deflate for Apache instead. Perhaps something like this:
Code: Select all
# COMPRESSION FOR SPEED
<IfModule mod_deflate.c>
AddOutputFilterByType DEFLATE text/html text/css text/plain
AddOutputFilterByType DEFLATE text/javascript application/javascript application/x-javascript
AddOutputFilterByType DEFLATE text/xml application/xml application/xhtml+xml application/rdf+xml application/rss+xml application/atom+xml image/svg+xml
AddOutputFilterByType DEFLATE font/truetype application/x-font-ttf font/opentype application/x-font-otf
</IfModule>
~ 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: Download corrupt files please help

Postby KezzBracey » October 11th, 2011, 10:44 pm

Wonderful, that did the trick! Thanks so much for that!! :D

I just bought the pro module to say "thankyou" properly. I really appreciate your help!

Cheers,

- Kezz

P.S. You might find it interesting that I found a zip file of mine wouldn't download if it had the word "insert" in it. I have a plugin called "EasyOptInserter" and couldn't get the download working with any variation of the word "insert" in it.

No hassle, just thought you might like to know. :)
User avatar
KezzBracey
Experienced User
Experienced User
 
Posts: 12
Joined: May 31, 2011

Re: Download corrupt files please help

Postby Jason Caldwell » October 12th, 2011, 12:26 pm

Thanks for the follow-up, and thanks for purchasing s2Member Pro.
We really appreciate your support!

Interesting. You might try this test also.
Remove the other hack that I posted, and try serving chunked files without a Content-Length header. Just remove the other hack I posted, and use this one instead. This way files are still delivered in chunks, but no Content-Length header is sent. I've seen a few servers that don't like Content-Length together with Transfer-Encoding: chunked, and this might be a good middle-ground for you.

Please report back if you can.

Create this directory and file:
/wp-content/mu-plugins/s2-hacks.php
Code: Select all
<?php add_filter("ws_plugin__s2member_chunk_file_downloads_w_content_length", "__return_false"); ?>
~ 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: Download corrupt files please help

Postby KezzBracey » October 12th, 2011, 7:42 pm

That worked great too and the downloads also seemed to come in noticeably faster.

Thanks very much for that!

s2Member now officially kicks the b*** of the other download protection and membership based options on the table. :D

I appreciate your time, especially taking the effort to give me two fixes. Awesome!
User avatar
KezzBracey
Experienced User
Experienced User
 
Posts: 12
Joined: May 31, 2011

Re: Download corrupt files please help

Postby Jason Caldwell » October 12th, 2011, 7:49 pm

Awesome. You're very welcome.
If you get a minute, can you please let me know who your host is, and/or at least what type of server you're running exactly? I'd like to see if we can detect this problem in advance, so that other site owners don't need to find this solution in the forum. For instance, are you on a Windows server? Or what are you running exactly? A test download link would be great too, if possible. You can send private information to us through this form: http://www.s2member.com/contact/
~ 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: Download corrupt files please help

Postby Cristián Lávaque » October 12th, 2011, 8:39 pm

Thanks for the kudos, Kezz! :)

What other download protection solutions had you tried before? Just curious.
Cristián Lávaque http://s2member.net
Is s2Member working for you? Please rate it Image at WordPress.org. Thanks! :)
User avatar
Cristián Lávaque
Developer
Developer
 
Posts: 6836
Joined: December 22, 2010

Re: Download corrupt files please help

Postby Jason Caldwell » October 25th, 2011, 5:55 pm

Details received via email. Thank you VERY much Kezz!

Glad to hear that you watched Zeitgeist.
Occupy: http://www.youtube.com/user/TZMOfficial ... kinHuvLEaU
~ 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: Download corrupt files please help

Postby KezzBracey » October 25th, 2011, 6:26 pm

Yes, all three movies were life changers.

Hey I found out one extra piece of information for you. The server I'm on uses LiteSpeed rather than Apache.

Also, the second fix seemed to work great for almost everyone, but then 2 people contacted me still getting the same issue, so I rolled back to the first fix you gave me which got them going again.

I've asked my host for any more information they can provide about the server setup, waiting to hear back atm.

Thanks!
User avatar
KezzBracey
Experienced User
Experienced User
 
Posts: 12
Joined: May 31, 2011

Re: Download corrupt files please help

Postby Jason Caldwell » October 25th, 2011, 6:34 pm

Thanks Kezz. I suspect this has something to do with header combinations, or possibly with output compression. Can you please email me an s2Member File Download Link so I can test for certain scenarios? I'll reply back to the email you sent, that way you can send it directly to me.
~ 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: Download corrupt files please help

Postby KezzBracey » October 26th, 2011, 12:30 am

Thanks Jason, just got back to your email.

Catch you shortly!

- Kezz
User avatar
KezzBracey
Experienced User
Experienced User
 
Posts: 12
Joined: May 31, 2011


Return to s2Member Plugin

Who is online

Users browsing this forum: Yahoo [Bot] and 0 guests

cron