Page 1 of 1

Large file downloads / tiny URL issue?

PostPosted: October 25th, 2010, 4:53 pm
by Harmonica Notes
I have a customer on email that just purchased a video series from me. They get to the download page and can see the links but when he clicks on the link it takes him to the squeeze page.

He says the link is a tiny url instead of the download.

When I look at them it shows the link and I can download the files.

I have him on email right now and am trying to get him fixed since he just bought otherwise I would do a more thorough search of the forums.

Can anyone link me to a post in the forums with an answer or give me a quick answer to get him up and running?

Re: tiny URL single post/page problems.

PostPosted: October 25th, 2010, 7:40 pm
by Harmonica Notes
I've learned more about this error. I can replicate it. I use the customer service url generator and create a new link to the page. I then send it to my test computer and try it. I can get to the download page but when I try to download it redirects me to the membership page there is also this ...?s2member_level_req=0... in the url.
The only user level access I have created was level 0 which I needed to create the the single page buy now button.
I'm certain this is a configuration error on my part. I just need to figure out what the problem is. I don't want to create a user site (yet) but I do want to sell e-products.

Any ideas would be appreciated including "moron, you need to look here..."

Re: tiny URL single post/page problems.

PostPosted: October 25th, 2010, 10:51 pm
by Jason Caldwell
Thanks for reporting your experience.
I use the customer service url generator and create a new link to the page. I then send it to my test computer and try it. I can get to the download page but when I try to download it redirects me to the membership page there is also this ...?s2member_level_req=0... in the url.

OK. So they're gaining access properly, but the download itself is failing.

It sounds to me like you're using s2Member's "Specific Post/Page Access" feature; which is NOT a part of s2Member's core functionality ( Membership management ). In other words, you've inadvertently mixed File Downloads ( a part of Membership Level Access ) with Specific Post/Page Access.

That being said, File Downloads CAN be made to work with Specific Post/Page Access.
- How to mix File Downloads with Specific Post/Page Access:

On the Post or Page that you're selling access to, whenever you create your download links, you will need to apply "Download Keys". You will find full instructions in your Dashboard, under:
s2Member -> Download Options -> Advanced Download Restrictions

---------------------------------------------------------------------------------------------------------

Advanced Download Restrictions ( optional, for greater flexibility )

By default, s2Member uses your Basic Download Restrictions, which work with Membership Level Access. However, you can force s2Member to allow file downloads, using an extra query string parameter ( s2member_file_download_key ). A file download `Key` is passed through this parameter, and it tells s2Member to allow the download of this particular file, regardless of Membership Level; and WITHOUT checking any Basic Restrictions, that you may, or may not, have configured.

Code: Select all
http://www.example.com/?s2member_file_download=example-file.zip&s2member_file_download_key=<?php echo s2member_file_download_key("example-file.zip"); ?>

The function `s2member_file_download_key()`, is part of the s2Member API. It produces a time-sensitive File Download Key that is unique to each and every visitor. Each Key it produces ( at the time it is produced ), will be valid for the current day, and only for a specific IP address and User-Agent string; as detected by s2Member. This makes it possible for you to create links on your site, which provide access to protected file downloads; and without having to worry about one visitor sharing their link with another. So let's take a quick look at what s2member_file_download_key() actually produces.

s2member_file_download_key ("example-file.zip") = a site-specific hash of s2member_xencrypt(date("Y-m-d") . $_SERVER["REMOTE_ADDR"] . $_SERVER["HTTP_USER_AGENT"] . $file)

When s2member_file_download_key = a valid Key, it works independently from Member Level Access. That is, a visitor does NOT have to be logged in to receive access; they just need a valid Key. Using this advanced technique, you could extend s2Member's file protection routines, or even combine them with Specific Post/Page Access, and more. The possibilities are limitless really.

Re: tiny URL single post/page problems.

PostPosted: October 25th, 2010, 11:00 pm
by Harmonica Notes
Yeah, I figured that out and implemented it. It solved my problem and I can get him to Download. Here's the kicker, the file sizes are 4k. they should average around 250 mb.

I love the functionality of the plugin. I figured there would be some growing pains and my customer is cool and helpful (Yay!!) I will eventually be doing this on a larger scale and this is a trial run. I'm glad for the troubles and the help.

Any ideas on why the file size problem?

Re: tiny URL single post/page problems.

PostPosted: October 25th, 2010, 11:14 pm
by Jason Caldwell
Awesome. Glad to hear that.
Thanks for reporting back on this.


Hmmm.. 4k file size. You've got me on that one.
So the file is corrupted?

You might try to re-upload all of your files to the /s2member-files/ directory. Make sure you upload images, music, and other non-text files in BINARY transfer mode. Only text/code files should be uploaded in ASCII format.

Re: tiny URL single post/page problems.

PostPosted: October 26th, 2010, 10:36 pm
by Dr Dave
You might also just check your file size using your ftp client. That will at least give you a head start in determining whether you've got some "bulk" in there.

(Beats having to spend the time uploading 250 mb for nothing, yes?

I'd be interested in the outcome of this question, because I think I ran across it somewhere in the past. (Maybe something will jog this "ancient" memory;-)

Re: tiny URL single post/page problems.

PostPosted: October 26th, 2010, 11:51 pm
by Harmonica Notes
Here's the update.
1. I have a zip file around 8 mb downloading and opening. This is with the s2member download key
2. I can DL the files if I take them out of security.
3. If I remove the download key and try to dl it as while logged in with my admin account, ithas the same problem
4. upped a zip of one of the videos, same problem.

could it be a file size issue?

I have turned off the wordpress code autocorrect stuff and disabled the visual editor.
I just watched the Rocky Horror episode of Glee and dug the Berry Bostwick/ Meatloaf walk on

Re: tiny URL single post/page problems.

PostPosted: October 27th, 2010, 2:16 am
by Jason Caldwell
Is it possible that your /s2member-files/ directory is actually a symbolic reference?
In other words, where is the actual location of your /s2member-files/ directory on the server?

It should be inside:
/wp-content/plugins/s2member-files/
and /s2member-files/ should be a directory, NOT a Symlink ( aka: a Shortcut ).
http://en.wikipedia.org/wiki/Symbolic_link

Re: tiny URL single post/page problems.

PostPosted: October 27th, 2010, 2:29 am
by Harmonica Notes
it's in /wp-content/plugins/
If you want, I can send you a link and the page code. You can have a look for yourself. feel free to learn some blues harmonica while you're at it.

Re: tiny URL single post/page problems.

PostPosted: October 27th, 2010, 3:19 am
by Jason Caldwell
Yes, that would be great. We have another report on this same issue and I would love to get it resolved. If you can provide me with a way to reproduce the issue on your installation, I would be very gracious.

Please use this private contact form:
http://www.s2member.com/contact/

If you can provide a Dashboard login and/or FTP access that would great too. Otherwise, I'll take what you can provide. I have a suspicion the issue is server dependent. So in order to correct this, I'll need FTP access to run some tests.

Re: tiny URL single post/page problems.

PostPosted: October 27th, 2010, 4:10 pm
by fitcajun
I'm having the same problem.

The tiny URL works just fine. The download key works fine. But my 32.8 mb PDF is downloading as a 241 kb file with no functionality. I used SmartFTP to upload the file to my S2member-files folder within the wp-content>plugins folder on my site. In my FTP viewer the file reads as the proper size. The file opens properly on my computer.

What should I do to fix this?

Re: tiny URL single post/page problems.

PostPosted: October 27th, 2010, 5:01 pm
by Jason Caldwell
Issue possibly resolved:

I believe we have this bug fixed. This odd behavior, when s2Member returns an invalid file size of just a few bytes on large files, was attributed to memory limitations of the readfile() function in PHP.

In the latest build of s2Member v3.2.9+, the issue has been corrected using feof() in chunks of 2048 bytes; so that very large files will no longer be an issue. You can download the latest development release here: http://www.primothemes.com/post/product ... th-paypal/

Thanks to everyone who reported this issue.
Please let us know if you continue to have trouble.

Re: tiny URL single post/page problems.

PostPosted: October 27th, 2010, 8:39 pm
by Dr Dave
Jason - Just to let you know - I use a number of plugins, but when I see an upgrade coming from the s2member team, it's the very first one I jump on! Bar none, I've learned more from tinkering in the back-end of s2member than I have from ANY other method.

Just sayin',
Dave

Re: tiny URL single post/page problems.

PostPosted: October 27th, 2010, 9:06 pm
by Harmonica Notes
I'm still having the same problem. The upgrade looks like It went in fine.

turned off all my plugins except wp exec, akismet and s2member to test if there was a conflict and had the same problem.

Jason. I'm sending you a link to the location so you can check it out yourself.

Re: tiny URL single post/page problems.

PostPosted: October 27th, 2010, 9:20 pm
by Harmonica Notes
Yippy! I just crashed my site!. It will be a while before I have it back up so I'll get back to you on access.

Re: tiny URL single post/page problems.

PostPosted: October 27th, 2010, 9:46 pm
by fitcajun
Yeah, I ran the update too and I'm still getting to the download window with my PDF showing only 241 kb of what should be 32.8 mb...

thoughts?

Re: tiny URL single post/page problems.

PostPosted: October 27th, 2010, 9:51 pm
by Jason Caldwell
Sorry for any confusion guys. This update has not been rolled out officially yet. I'm attaching the latest development version for all to use, or you can also download it directly from our website:
http://www.primothemes.com/post/product ... th-paypal/

s2member.zip
(5.49 MiB) Downloaded 464 times
this is s2Member v3.2.9 / build 32
( includes a possible fix for large file downloads )

If all goes well, the change will be released officially with s2Member v3.3.


Scratch this.
Please use build #33 below until s2Member v3.3 is released.

Re: tiny URL single post/page problems.

PostPosted: October 27th, 2010, 11:18 pm
by Harmonica Notes
Downloaded and installed the zip, file size of download went from 4k to zero.

Re: tiny URL single post/page problems.

PostPosted: October 27th, 2010, 11:38 pm
by Jason Caldwell
Thanks for the follow-up. I received your Dashboard login via email. The investigation is underway.
Harmonica Notes wrote:Downloaded and installed the zip, file size of download went from 4k to zero.

Re: Large file downloads / tiny URL issue?

PostPosted: October 28th, 2010, 5:19 am
by Jason Caldwell
Investigation completed. Possible bug fix attached.

Use of PHP's fread() function has been updated to stream_get_contents() with a 2MB chunk size in order to satisfy the needs of site owners delivering VERY large files ( 500MB+ ) though simulated HTTP streams "inline". For instance, an MP4 video file into a FlowPlayer/JWPlayer or another Flash-based application.

In addition, s2Member is now capable of output buffering its chunked file delivery, making it possible for s2Member to deliver VERY large files through most shared hosting platforms without needing to upgrade to a private server.

Related article: ( via Dreamhost )
http://forum.dreamhosters.com/programmi ... d-fail.htm
^ s2Member's file delivery system is now capable of circumventing the limitation discussed here.

This update has not been rolled out officially yet. I'm attaching the latest development version for all to use, or you can also download it directly from our website:
http://www.primothemes.com/post/product ... th-paypal/

s2member.zip
(5.49 MiB) Downloaded 405 times
this is s2Member v3.2.9 / build #33
( includes a possible fix for large file downloads )

If all goes well, the change will be released officially with s2Member v3.3.

Re: Large file downloads / tiny URL issue?

PostPosted: October 28th, 2010, 11:47 am
by Harmonica Notes
Awesome! It looks to be working great. Jason, you rock. Thanks for the help.

Re: Large file downloads / tiny URL issue?

PostPosted: October 29th, 2010, 12:31 am
by Dr Dave
Very cool!

Re: Large file downloads / tiny URL issue?

PostPosted: October 30th, 2010, 1:16 pm
by ryannagy
Amazing. Thanks Jason. I will try it out ASAP. - Ryan