PHP code example of retrowaver / chomikuj2

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

    

retrowaver / chomikuj2 example snippets


use Chomikuj\Api;

//...

$chomikuj = new Api();
$chomikuj->login('username', 'password');

// Create some folders in root folder (0)
$chomikuj->createFolder('some folder', 0);
$chomikuj->createFolder('some NSFW folder', 0, true);
$chomikuj->createFolder('some password-protected folder', 0, false, 'some_password');

// Remove folder with id 12345
$chomikuj->removeFolder(12345);

// Upload a file to root folder
$chomikuj->uploadFile(0, 'path/to/file.zip');

// Upload a file to a folder with id 12
$chomikuj->uploadFile(12, 'path/to/another/file.zip');

$chomikuj->logout();