PHP code example of scaleflex / filerobot

1. Go to this page and download the library: Download scaleflex/filerobot 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/ */

    

scaleflex / filerobot example snippets

 php
new FilerobotAdapter(your_api_key)
 php

use Scaleflex\Filerobot\FilerobotAdapter;

class Foo {
    protected $filerobot;
    
    public function __construct()
    {
        $this->filerobot = new FilerobotAdapter('fa5fe3303dd34e1da4810915c7c3fd6f');
    }
    
    public function bar () {
        return $this->filerobot->list_file('/api-demo');
    }
}
 php
return $this->filerobot->list_file('/api-demo');
 php
return $this->filerobot->detail_file($file_uuid);
 php
return $this->filerobot->rename_file($file_uuid, $new_filename);
 php
return $this->filerobot->move_file($file_uuid, $folder_uuid);
 php
return $this->filerobot->delete_file($file_uuid);
 php
return $this->filerobot->upload_file_multipart('/api-demo', '/path/bear.jpg', 'bear.jpg');
 php
return $this->filerobot->upload_file_remote('/api-demo', '[{"name": "new_filename.jpg",  "url":"http://sample.li/boat.jpg" }]');
 php
$image = base64_encode(file_get_contents('path/bear.jpeg'));
return $this->filerobot->upload_file_binary('/folder/new_image_from_base64.png', $image)
 php
$photo = fopen('/path/bear.jpg', 'r');
return $this->filerobot->stream_upload_file('/api-demo', $photo, 'bear.jpg');
 php
return $this->filerobot->update_file_metadata($file_uuid, '{"title": {"de_DE": "Boot",  "en_US": "boat"}}');
 php
return $this->filerobot->list_folder('/api-demo');
 php
return $this->filerobot->detail_folder($folder_uuid);
 php
return $this->filerobot->rename_folder($folder_uuid, $new_foldername);
 php
return $this->filerobot->move_folder($folder_uuid, $destination_folder_uuid);
 php
return $this->filerobot->delete_folder($folder_uuid);
 php
return $this->filerobot->create_folder($foldername)