latest stable versions: v150827 (changelog)

Old Forums (READ-ONLY): The community now lives at WP Sharks™. If you have an s2Member® Pro question, please use our new Support System.

Protected PDF's downloading corrupt

Home Forums Community Forum Protected PDF's downloading corrupt

This topic contains 13 replies, has 5 voices. Last updated by  Epix Media 4 years, 6 months ago.

Topic Author Topic
Posted: Wednesday Jun 6th, 2012 at 12:49 pm #15698
Epix Media
Username: epixmedia

Hi all, I’m using the secure file uploader plugin to add PDF’s to a page, the files open fine before upload but when you login as a member and download them they don’t open – acrobat gives a corrupt file message…

…any ideas??

Cheers!

List Of Topic Replies

Viewing 13 replies - 1 through 13 (of 13 total)
Author Replies
Author Replies
Posted: Wednesday Jun 6th, 2012 at 1:35 pm #15703
Eduan
Username: Eduan
Moderator

Hello Epix,

Have you tried uploading the file without the file uploader? In other words, through FTP.

Tell me how it goes. :)

Posted: Wednesday Jun 6th, 2012 at 1:39 pm #15704
Epix Media
Username: epixmedia

Hi Eduan, I have and they are still corrupt when you download via the website.

If I download them via FTP they are fine, just corrupt when I download through the website – I’ve tried both Firefox and Chrome and the client is having the same issue too!

…any more ideas???

Posted: Thursday Jun 7th, 2012 at 5:42 am #15773
Epix Media
Username: epixmedia

Any suggestions on this one? I’ve had to put the files up as unprotected for now which isn’t ideal….

Posted: Thursday Jun 7th, 2012 at 10:51 am #15794
Raam Dev
Username: Raam
Staff Member

Hi Zoe,

Have you tried the suggestions in the following KB article? Knowledge Base » Resolving Problems with File Downloads

Posted: Friday Jun 8th, 2012 at 10:13 am #15932
Epix Media
Username: epixmedia

Disable GZIP compression .htaccess code is already in place. As is the .htaccess folder in /s2member-files/.

I’ve also added the three lines to s2-hacks.php and retested but no luck :(

Any more ideas??

Posted: Friday Jun 8th, 2012 at 9:28 pm #16009
Raam Dev
Username: Raam
Staff Member

You mentioned that you were using the “secure file uploader plugin” to upload the files. Have you tried uploading the files via FTP? It’s possible that plugin is causing the problem.

Posted: Monday Jun 11th, 2012 at 11:40 am #16136
Epix Media
Username: epixmedia

Hi Raam, I’ve tried directly uploading the files via FTP and they are still corrupt when they are downloaded through the website.

If I download them via FTP after uploading they are still fine. Something is happening to them when being downloaded via the website…

:(

  • This reply was modified 4 years, 7 months ago by  Epix Media.
Posted: Tuesday Jun 12th, 2012 at 6:50 am #16226

Hi Epix.

Could you send your login info using the contact form, in case Jason needs to take a look at it? s2Member® » Private Contact Form

Thanks!

Posted: Tuesday Jun 12th, 2012 at 8:52 am #16243
Epix Media
Username: epixmedia

Thanks Cristian, I’ve done that and attached a screen grab of the error acrobat is throwing up too. Could it be to do with the way the client has saved the PDF?

Zoe

Posted: Wednesday Jun 13th, 2012 at 12:06 am #16337
Staff Member

Thanks for the heads up on this request for support.

I’ve run diagnostics on your installation, and I find that your server is ignoring all of s2Member’s attempts to disable GZIP during the delivery of a PHP-based file download. Even the .htaccess rule is being ignored.

Only solution that seems to work on your installation:

I updated this file:
/s2member/classes/files-in.inc.php at line #352
I changed this:

header("Content-Encoding:");

To this: (and it’s working as expected now)

header("Content-Encoding: none");

Please note that header("Content-Encoding: none");, is an invalid header specification. Which is why s2Member does not use this by default. However, there are certain cases where this header can be set to “none”, to force a server that is not listening to standard directives, to NOT apply GZIP compression. This seems to do the trick on your installation.

So that we may tune things in further as we move forward with s2Member, can you please let me know who your hosting provider is? If it’s a private server, can you please list the main server components that you’re running, and how/where GZIP compression has been applied/configured?
Posted: Wednesday Jun 13th, 2012 at 3:40 am #16339
Epix Media
Username: epixmedia

Hi Jason, thanks for the quick reply, the hosting for this site is run by the clients IT company. I will forward your message on to them and see if they can provide some more info.

I pressume that even though the header you added is invalid it won’t have any adverse effects on the site?

Thanks again :)

Zoe

Posted: Saturday Jun 16th, 2012 at 7:56 am #16666
Staff Member

Thanks for the follow-up.

I pressume that even though the header you added is invalid it won’t have any adverse effects on the site?

Nothing serious, no. There are a few cases where some HTTP clients may interpret “none” as a form of compression, and attempt to decompress the file being served by s2Member. This can lead to file corruption, but it’s a rare occurrence, particularly with browsers; this is more of an issue with script-based HTTP clients.

So you should be fine, is what I’m saying. If you can find a way to get this working, without the hack; that’s obviously better, but not necessarily required at this point.

Posted: Friday Jun 22nd, 2012 at 11:16 am #17194
Epix Media
Username: epixmedia

Thanks again Jason, I did email the clients IT company but they didn’t respond! I appreciate the help and advice though and all is working now :)

Viewing 13 replies - 1 through 13 (of 13 total)

This topic is closed to new replies. Topics with no replies for 2 weeks are closed automatically.

Old Forums (READ-ONLY): The community now lives at WP Sharks™. If you have an s2Member® Pro question, please use our new Support System.

Contacting s2Member: Please use our Support Center for bug reports, pre-sale questions & technical assistance.