Community Support Forums — WordPress® ( Users Helping Users ) — 2011-12-30T21:44:33-05:00 http://www.primothemes.com/forums/feed.php?f=36&t=16208 2011-12-30T21:44:33-05:00 http://www.primothemes.com/forums/viewtopic.php?t=16208&p=59298#p59298 <![CDATA[Re: File Size, Date and Checksum with S3 Downloads]]> I see you solved the other issue with + file names as well.

I posted a quick reply in this thread, and we'll take a closer look at implementing a patch in the next release: viewtopic.php?f=4&t=16611&p=59297#p59297

Statistics: Posted by Jason Caldwell — December 30th, 2011, 9:44 pm


]]>
2011-12-30T01:55:11-05:00 http://www.primothemes.com/forums/viewtopic.php?t=16208&p=59206#p59206 <![CDATA[Re: File Size, Date and Checksum with S3 Downloads]]>
Jason Caldwell wrote:
Thanks for the heads up on this thread.

This is not something that s2Member makes possible in the current release. At some point in the future, we may release a set of developer tools to assist with this. Until then, I would recommend this PHP class, using the getObjectInfo() method. If we ever build a set of developer tools for S3, we would most likely base it on this class, which has already been well tested for some years now.

See: http://undesigned.org.za/2007/10/22/ama ... umentation
getObjectInfo: http://undesigned.org.za/2007/10/22/ama ... ObjectInfo


Many thanks for this Jason.
I wrote a couple of short-codes to bring back the file-size for example:
Code:
/*
  Shortcode to return filesize and checksum from Amazon S3
  install S3.php class file in mu-plugin dir.
  call with [get-s3fileinfo]URI of object[/get-s3fileinfo]
*/
add_shortcode('get-s3fileinfo', 'get_s3fileinfo');
   function get_s3fileinfo($atts, $content = null){
   //include the S3 class  in case mu_plugin fails
   if (!class_exists('S3'))require_once('S3.php'); 
 
   //AWS access info 
   if (!defined('awsAccessKey')) define('awsAccessKey', 'Input access key here'); 
   if (!defined('awsSecretKey')) define('awsSecretKey', 'Input Sectret key here'); 
 
   //instantiate the class 
   $s3 = new S3(awsAccessKey, awsSecretKey); 

   $bucket = 'Bucket-Name';
   $uri = $content;
   if (($info = $s3->getObjectInfo($bucket, $uri)) !== false) {
        /*print_r($info);*/
    if (is_array ($info) && !empty ($info))
     {
       echo "Checksum: $info[hash]";
       echo "<br/>";
       echo "File size:  $info[size]";
    }
    }
}


All works well :mrgreen: other than when the filename has a + in the name.
S2member also fails, as written about in my new post. :?

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


]]>
2011-12-19T13:21:07-05:00 http://www.primothemes.com/forums/viewtopic.php?t=16208&p=56938#p56938 <![CDATA[Re: File Size, Date and Checksum with S3 Downloads]]>
Colin

Statistics: Posted by colinp386 — December 19th, 2011, 1:21 pm


]]>
2011-12-19T11:50:54-05:00 http://www.primothemes.com/forums/viewtopic.php?t=16208&p=56929#p56929 <![CDATA[Re: File Size, Date and Checksum with S3 Downloads]]> Thanks for the heads up on this thread.

This is not something that s2Member makes possible in the current release. At some point in the future, we may release a set of developer tools to assist with this. Until then, I would recommend this PHP class, using the getObjectInfo() method. If we ever build a set of developer tools for S3, we would most likely base it on this class, which has already been well tested for some years now.

See: http://undesigned.org.za/2007/10/22/ama ... umentation
getObjectInfo: http://undesigned.org.za/2007/10/22/ama ... ObjectInfo

Statistics: Posted by Jason Caldwell — December 19th, 2011, 11:50 am


]]>
2011-12-18T15:59:10-05:00 http://www.primothemes.com/forums/viewtopic.php?t=16208&p=56841#p56841 <![CDATA[Re: File Size, Date and Checksum with S3 Downloads]]>

Statistics: Posted by Cristián Lávaque — December 18th, 2011, 3:59 pm


]]>
2011-12-16T12:24:30-05:00 http://www.primothemes.com/forums/viewtopic.php?t=16208&p=56687#p56687 <![CDATA[Re: File Size, Date and Checksum with S3 Downloads]]>

Statistics: Posted by colinp386 — December 16th, 2011, 12:24 pm


]]>
2011-12-06T10:24:25-05:00 http://www.primothemes.com/forums/viewtopic.php?t=16208&p=54663#p54663 <![CDATA[File Size, Date and Checksum with S3 Downloads]]>
I would like to provide, file size, date and checksum of the files being downloaded from Amazon's S3 service.
How easy would that be to do with after the download had been completed or while it's in process.

Seems like this would be a nice feature to add, for those who like to check the integrity of their downloads
S3 stores this info in their store.

Many thanks.

Colin

Statistics: Posted by colinp386 — December 6th, 2011, 10:24 am


]]>