PHP code example of bybzmt / simple-http-storage

1. Go to this page and download the library: Download bybzmt/simple-http-storage 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/ */

    

bybzmt / simple-http-storage example snippets


$storage = new SimpleHttpStorage($server, $port, $timeout);
//上传
$storage->put(__FILE__, '/test.txt');
//下载
$storage->get("/test.txt", "./test.txt");
//删除
$storage->delete("/test.txt");
//判断文件是否存在
var_dump($storage->exists("/test.txt"));