jDownloadsownloads.com

Advertisement:

Author Topic: Amazon S3 Support  (Read 4256 times)

0 Members and 1 Guest are viewing this topic.

Offline water

  • Full Member
  • ***
  • Posts: 113
Amazon S3 Support
« on: 25.10.2011 17:12:26 »
Hello Arno. It will be great if you can integrate amazon S3 stores plugin into JDownloads? as it will decrease site load and will save us lots of bandwidth

Offline progandy

  • Newbie
  • *
  • Posts: 21
Re: Amazon S3 Support
« Reply #1 on: 25.10.2011 23:50:48 »
This is a nice idea. Why not create a general API in 2.0 so that you can simply add new storage methods and choose them on a file/category basis. e.g. database storage, file system, amazon S3 (the service should support creation of time limited links, too) ;)

Offline water

  • Full Member
  • ***
  • Posts: 113
Re: Amazon S3 Support
« Reply #2 on: 02.11.2011 03:57:49 »
yeah will be great. Some other component are supporting S3 and other files hosting server

Offline Arno

  • Administrator
  • ***
  • Posts: 11.037
    • jDownloads.com
Re: Amazon S3 Support
« Reply #3 on: 02.11.2011 09:32:14 »
When anybody can send me a script sample to use amazon S3, i will seen what i can do.
Best Regards / Gruß
Arno
Please make a Donation for jDownloads and/or write a review on the Joomla! Extensions directory!

Offline MDS

  • Newbie
  • *
  • Posts: 30
    • My Digital Star
Re: Amazon S3 Support
« Reply #4 on: 02.11.2011 09:53:04 »
What happens when files are stored on Amazon servers is damaged?  ;)

Offline MDS

  • Newbie
  • *
  • Posts: 30
    • My Digital Star
Re: Amazon S3 Support
« Reply #5 on: 02.11.2011 10:01:38 »
I'm not sure, but maybe it will be useful for you?:

http://net.tutsplus.com/tutorials/php/how-to-use-amazon-s3-php-to-dynamically-store-and-manage-files-with-ease/

php-script to clean old files to Amazon S3:

Code: [Select]
<?php

/**
 * @example "s3cmd ls s3://bucket/path/to/dir/ | php this_file.php"
 */

define'NUM_DAYS'10 );

$stdin file'php://stdin'FILE_IGNORE_NEW_LINES );
$files = array();
for ( 
$i=0$len=count$stdin ); $i<$len$i++ ) {
# &#1087;&#1088;&#1086;&#1087;&#1091;&#1089;&#1082;&#1072;&#1077;&#1084; &#1087;&#1077;&#1088;&#1074;&#1091;&#1102; &#1089;&#1090;&#1088;&#1086;&#1082;&#1091;, &#1087;&#1086;&#1089;&#1082;&#1086;&#1083;&#1100;&#1082;&#1091; &#1074; &#1085;&#1077;&#1081; &#1089;&#1086;&#1076;&#1077;&#1088;&#1078;&#1080;&#1090;&#1089;&#1103; &#1090;&#1077;&#1082;&#1091;&#1097;&#1072;&#1103; &#1076;&#1080;&#1088;&#1077;&#1082;&#1090;&#1086;&#1088;&#1080;&#1103;
if ( $i == ) {
continue;
}

# 1 - &#1076;&#1072;&#1090;&#1072; &#1087;&#1086;&#1089;&#1083;&#1077;&#1076;&#1085;&#1077;&#1075;&#1086; &#1080;&#1079;&#1084;&#1077;&#1085;&#1077;&#1085;&#1080;&#1103;
# 2 - &#1088;&#1072;&#1079;&#1084;&#1077;&#1088; &#1074; &#1073;&#1072;&#1081;&#1090;&#1072;&#1093;
# 3 - &#1072;&#1076;&#1088;&#1077;&#1089; &#1074; &#1073;&#1091;&#1082;&#1077;&#1090;&#1077;
preg_match'#([\d]{4}-[\d]{2}-[\d]{2}\s[\d]{2}:[\d]{2})[\s]+([\d]+)[\s]+(s3://.*)#'$stdin$i ], $matches );

$matches[1] = strtotime$matches[1] );
$files[] = $matches;
}

$bestBefore time() - NUM_DAYS*86400;
foreach ( 
$files as $file ) {
if ( $file[1] < $bestBefore ) {
$command 's3cmd del ' str_replace' ''+'$file[3] );
`$command`;
}
}

Offline Arno

  • Administrator
  • ***
  • Posts: 11.037
    • jDownloads.com
Re: Amazon S3 Support
« Reply #6 on: 02.11.2011 12:52:15 »
Hi MDS,
many thanks for the link above. i hope we can use this class.  ;D
Best Regards / Gruß
Arno
Please make a Donation for jDownloads and/or write a review on the Joomla! Extensions directory!

Offline MDS

  • Newbie
  • *
  • Posts: 30
    • My Digital Star
Re: Amazon S3 Support
« Reply #7 on: 02.11.2011 13:58:37 »
Hi! I was glad to help!  :)

Offline turminator

  • jD Translator
  • *
  • Posts: 232
Re: Amazon S3 Support
« Reply #8 on: 16.02.2012 09:48:49 »
This will be great and can save a lots of bandwith. Many thanks for this great project. :)