public static function get() { if (S3ClientBuilder::$client == null) { S3ClientBuilder::$client = S3Client::factory(); } return S3ClientBuilder::$client; }
}); </script> <?php } else { //print_r($_POST); //print_r($_FILES); echo "<div hidden>"; $name = $_FILES['avatar']['name']; $email_owner = "admin_off"; $_type = "admin"; $children = array(); // UPLOAD SUR S3 $s3 = new S3Access(S3ClientBuilder::get()); $url = $s3->createFile($name, $_FILES['avatar']['tmp_name']); //$path); // INSERT SUR DYNAMO $contentDao = new ContentDAO(DynamoDbClientBuilder::get()); $content = new Content(); $content->setUrl($url); $content->setEmailOwner($email_owner); $content->setName($name); $content->setType($_type); $contentDao->create($content, $children); echo "</div>La slide a été ajouter : <a href='https://s3-eu-west-1.amazonaws.com/cherry-shared-content2/" . $name . "'>" . $name . "</a>"; } ?> </body>