PHP code example of rafapaulino / php-azure-upload
1. Go to this page and download the library: Download rafapaulino/php-azure-upload library. Choose the download type require. 2. Extract the ZIP file and open the index.php. 3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
rafapaulino / php-azure-upload example snippets
use PHPAzureUpload\Connection;
use PHPAzureUpload\Factory;
$connection = new Connection;
$connection->setConnectionString("conectionstring")
->setAccountName("accountname")
->setAccountKey("accountkey")
->setProtocol("https");
$factory = new Factory($connection, "http://accounturl");
$factory->setContainer("extranet");
if ($_SERVER['REQUEST_METHOD'] == "POST") {
echo '<pre>';
$file = $_FILES['userfile']['tmp_name'];
$name = trim(strtolower($_FILES['userfile']['name']));
$name = str_replace(" ", "-", $name);
print_r($_FILES);
$result = $factory->create($file, $name);
var_dump($result);
echo '</pre>';
}