Пример #1
0
 public static function save($file_path, $file_name = null, $upload_type = 'img', $is_private_acl = false)
 {
     if (!file_exists($file_path)) {
         throw new FuelException('File not exists.');
     }
     static::set_s3_instanse();
     return self::$s3_instantse->putObject(array('Bucket' => FBD_AWS_S3_BUCKET, 'Key' => static::get_key($file_name ?: \Site_Upload::get_file_name_from_file_path($file_path), $upload_type), 'Body' => EntityBody::factory(fopen($file_path, 'r')), 'ACL' => $is_private_acl ? CannedAcl::PRIVATE_ACCESS : CannedAcl::PUBLIC_READ));
 }