Yandex disk için bunu kullanmaktayım hocam. Bir php sayfa oluşturup bunu koyduktan sonra dosya adı, mail şifre ve dizin ayarlaması yapıp tarayıcıda url girdiğinizde seçilen dosya türü(zip, rar,html,jpeg otomatik olarak yandex aktarımı sağlıyor. Kod bilgim yok bir siteden aldım içeriğini inceleyip kullanmanızı tavsiye ederim. Kendim kullanıyorum ama kimse ye de sorun yaratmak istemem 😊
<?php
set_time_limit(0);
$dosyaadi="yedek.zip";
$user="mailadresiniz@yandex.com";
$password="şifre";
$credentials = array($user,$password);
$filename = $dosyaadi;
$filepath = '/home/kullanici/public_html/yandex/'.$filename;
$filesize = filesize($filepath);
$fh = fopen($filepath, 'r');
$remoteUrl = 'https://webdav.yandex.com.tr/';
$ch = curl_init($remoteUrl . $filename);
curl_setopt($ch, CURLOPT_HTTPAUTH, CURLAUTH_ANY);
curl_setopt($ch, CURLOPT_USERPWD, implode(':', $credentials));
curl_setopt($ch, CURLOPT_PUT, true);
curl_setopt($ch, CURLOPT_INFILE, $fh);
curl_setopt($ch, CURLOPT_INFILESIZE, $filesize);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_VERBOSE, 1);
curl_setopt($ch, CURLOPT_HEADER, 1);
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT ,0);
curl_setopt($ch, CURLOPT_TIMEOUT, 400);
$response=curl_exec($ch);
fclose($fh);
?>