Ejemplo n.º 1
0


         </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>
Ejemplo n.º 2
0
for ($i = 1; $i < $size; $i++) {
    //Iterate over the files(start 1)
    // UPLOAD SUR EC2
    $path = "/var/www/html/";
    $name = $_FILES['files']['name'][$i];
    $path = $path . $name;
    //echo move_uploaded_file($_FILES['files']['tmp_name'][$i], $path);
    /*if(move_uploaded_file($_FILES['files']['tmp_name'][$i], $path))
      {
          echo "!!!! OK !!!!";}
      else {
          echo "??? NO OK ????";
      }*/
    // UPLOAD SUR S3
    $s3 = new S3Access(S3ClientBuilder::get());
    $url = $s3->createFile($name, $_FILES['files']['tmp_name'][$i]);
    //$path);
    // INSERT SUR DYNAMO
    $emailOwner = $_SESSION['email'];
    $type = $_SESSION['type'];
    $contentDao = new ContentDAO(DynamoDbClientBuilder::get());
    $content = new Content();
    $content->setUrl($url);
    $content->setEmailOwner($emailOwner);
    $content->setName($name);
    $content->setType($type);
    $contentDao->create($content, $children);
}
?>
</body>
</html>