Community Support Forums — WordPress® ( Users Helping Users ) — 2012-01-02T21:45:15-05:00 http://www.primothemes.com/forums/feed.php?f=4&t=16611 2012-01-02T21:45:15-05:00 http://www.primothemes.com/forums/viewtopic.php?t=16611&p=59474#p59474 <![CDATA[Re: S3 File witgh special chars access problem]]>
Thank you very much for posting this workaround! :) I can see that shortcode coming in handy.

Statistics: Posted by Raam Dev — January 2nd, 2012, 9:45 pm


]]>
2011-12-31T11:40:18-05:00 http://www.primothemes.com/forums/viewtopic.php?t=16611&p=59349#p59349 <![CDATA[Re: S3 File witgh special chars access problem]]> Class: c_ws_plugin__s2member_files_in
Method: amazon_s3_url
Code:
$file = rawurlencode($file);


To make downloads work we made a simple user function:
Code:
add_shortcode('url-encode', 'wp_url_encode_wrapper');
   function wp_url_encode_wrapper($atts, $value){
     return urlencode($value);
}



And added it to the get file url ie.

Code:
<a href="/?s2member_file_download=/sparc/10/[url-encode]gtk+-2.12.0-sol10-sparc-local.gz[/url-encode]">gtk+-2.12.0-sol10-sparc-local.gz</a>


So while it does not fix what looks to be an issue with the plugin (I reserve the right to be wrong ;) ) it does give us a work around

This is really a cludge and a better fix is needed.
Note we make a mistake originally and encoded the basename as well, not realizing it was the return filename, oops :-)

Statistics: Posted by colinp386 — December 31st, 2011, 11:40 am


]]>
2011-12-30T22:25:18-05:00 http://www.primothemes.com/forums/viewtopic.php?t=16611&p=59306#p59306 <![CDATA[Re: S3 File witgh special chars access problem]]> ~ I appreciate your efforts though, it really helps!

Statistics: Posted by Jason Caldwell — December 30th, 2011, 10:25 pm


]]>
2011-12-30T22:06:35-05:00 http://www.primothemes.com/forums/viewtopic.php?t=16611&p=59304#p59304 <![CDATA[Re: S3 File witgh special chars access problem]]> Statistics: Posted by colinp386 — December 30th, 2011, 10:06 pm


]]>
2011-12-30T21:41:14-05:00 http://www.primothemes.com/forums/viewtopic.php?t=16611&p=59297#p59297 <![CDATA[Re: S3 File witgh special chars access problem]]> Statistics: Posted by Jason Caldwell — December 30th, 2011, 9:41 pm


]]>
2011-12-30T17:51:23-05:00 http://www.primothemes.com/forums/viewtopic.php?t=16611&p=59275#p59275 <![CDATA[Re: S3 File witgh special chars access problem]]>
Likely if there is an issue with any file access issues we will find them LoL

Best

Colin

Statistics: Posted by colinp386 — December 30th, 2011, 5:51 pm


]]>
2011-12-30T13:01:11-05:00 http://www.primothemes.com/forums/viewtopic.php?t=16611&p=59240#p59240 <![CDATA[Re: S3 File witgh special chars access problem]]>
Cristián Lávaque wrote:
I'll email Jason about this.

Maybe you should remove the plus sign from the file name to avoid this problem in the meantime. :)


Tell me about it! LoL I think that's what I may have to do, its a royal PITA to find and replace 80 files out of 14,000 on S3 :cry:

Thanks for the escalation. I blame those FOSS communities for creating packages with friggin + signs in the package name! Argh!!

Statistics: Posted by colinp386 — December 30th, 2011, 1:01 pm


]]>
2011-12-30T04:40:53-05:00 http://www.primothemes.com/forums/viewtopic.php?t=16611&p=59222#p59222 <![CDATA[Re: S3 File witgh special chars access problem]]>
Maybe you should remove the plus sign from the file name to avoid this problem in the meantime. :)

Statistics: Posted by Cristián Lávaque — December 30th, 2011, 4:40 am


]]>
2011-12-30T02:07:34-05:00 http://www.primothemes.com/forums/viewtopic.php?t=16611&p=59207#p59207 <![CDATA[Re: S3 File witgh special chars access problem]]>
The string is being un-encoded and its changing the plus to a space which is what it's supposed to do.
As when you encode a string a space is converted to a plus
I see that now in the report of the Key <Key>sparc/8/gtk -2.12.0-sol8-sparc-local.gz</Key>
as it was gtk+-2.12

Any ideas?

Statistics: Posted by colinp386 — December 30th, 2011, 2:07 am


]]>
2011-12-30T01:42:15-05:00 http://www.primothemes.com/forums/viewtopic.php?t=16611&p=59205#p59205 <![CDATA[S3 File witgh special chars access problem]]>
Looking for some help in tracking down an issue with downloading files via s2Member from AmazonS3 when the file/object name contains a + or ++

If I make the file public I am able to access it via the Amazon file download URL
https://s3.amazonaws.com/unixpackages/sparc/10/gtk%2B-2.12.0-sol10-sparc-local.gz
without any issues.

If I try accessing the file via s2member with
http://domain.com/?s2member_file_download=/sparc/8/gtk%2B-2.12.0-sol8-sparc-local.gz
it errors with:

<Error>
<Code>NoSuchKey</Code>
<Message>The specified key does not exist.</Message>
<Key>sparc/8/gtk -2.12.0-sol8-sparc-local.gz</Key>
<RequestId>B4304A631D838725</RequestId>
<HostId>XXXXXXXXXX</HostId>
</Error>


if I use the + rather than %2B ie
http://domain.com/?s2member_file_download=/sparc/8/gtk+-2.12.0-sol8-sparc-local.gz
I get:

<Error>
<Code>SignatureDoesNotMatch</Code>
<Message>The request signature we calculated does not match the signature you provided. Check your key and signing method.</Message>
<StringToSignBytes>47 45 54 0a
<snip --
||
snip >
6e 73 65 2d 65 78 70 69 72 65 73 3d 46 72 69 2c 20 32 33 20 44 65 63 20 32 30 31 31 20 30 32 3a 34 31 3a 30 35 20 47 4d 54</StringToSignBytes>
<RequestId>8A90E89632DA6ADB</RequestId>
<HostId>XXXXXXXXX</HostId>
<SignatureProvided>XXXXXXXXXSignatureProvided>
<StringToSign>GET 1325212895
/unixpackages/sparc/8/gtk-2.12.0-sol8-sparc-local.gz?response-cache-control=no-cache, must-revalidate, max-age=0, post-check=0, pre-check=0&response-content-disposition=attachment; filename="gtk -2.12.0-sol8-sparc-local.gz"&response-content-type=application/x-gzip&response-expires=Fri, 23 Dec 2011 02:41:05 GMT</StringToSign>
<AWSAccessKeyId>XXXXXXXXX</AWSAccessKeyId>
</Error>


I am also using . Donovan Schonknecht's S3php class to bring back the file attributes and that also fails on these files, I'm trying to figure out if its a generic AmazonS3 issue of it it's a problem with a lack of URL encoding by the plugin/class. I am on a version of PHP that supports encoding.

Any help much appreciated, as its not easy for me to have to remove all the +'s from the file names.

Colin

Statistics: Posted by colinp386 — December 30th, 2011, 1:42 am


]]>