PHP code example of friday14 / cloud-mail-ru

1. Go to this page and download the library: Download friday14/cloud-mail-ru 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/ */

    

friday14 / cloud-mail-ru example snippets

 php
$cloud = new \Friday14\Mailru\Cloud('yourLogin', 'yourPassword', 'yourDomain');
 php
$cloud = new \Friday14\Mailru\Cloud('friday14', 'password', 'mail.ru');
 php
$cloud->files('/cloud-root');
 php
$cloud->createFile('/ololo.txt','Hello World');
 php
$cloud->createFolder('/foldername');
 php 
$cloud->delete('/wallaper.jpg');
 php
$cloud->rename('/cloud-folder/wallaper.jpg', 'newName.jpg');
 php
    $file = new SplFileObject($_SERVER['DOCUMENT_ROOT'] . '/teremok.jpg');
    $cloud->upload($file, '/wallapers/super-teremok.jpg');
 php 
  $cloud->download('/wallapers/super-teremok.jpg', $_SERVER['DOCUMENT_ROOT'] . '/folder/filename.format');
 php
  $cloud->publishFile('/wallapers/super-teremok.jpg');
 php
  $cloud->getLink('/wallapers/super-teremok.jpg') // return https://cloclo4.cloud.mail.ru/thumb/xw1/wallapers/super-teremok.jpg