humanemulator.net — справка.
Продукт, демо и покупка — на
хуманэмулятор.рф
|
Демо
|
Купить
|
API
|
Changelog
remove_file
remove_file($server,$file_name); - Удалить файл с FTP сервераФункция на вход принимает параметры:
После выполнения функции возвращаемое значение будет равно одному из двух :
Пример использования
<?php // Scenario: Remove a file from a WebDAV server $xhe_host = getenv("RPABOT_HOST_URL"); if (!isset($path)) { // Path to the init.php file for connecting to the XHE API $path = "../../../Templates/init.php"; // Including init.php grants access to all classes and functionality for working with the XHE API require($path); } // Start echo "\n<font color=blue>webdav->" . basename(__FILE__) . "</font>\n"; // Account credentials $server = "https://webdav.yandex.ru"; $login = "xxx@yandex.ru"; $password = "xxx"; // Step: Connect to WebDAV server echo "1. Connect to server: " . $server . " : "; $connectResult = WEB::$webdav->connect($server, $login, $password); echo $connectResult . "\n"; // Step: Upload a test file echo "2. Upload test file: "; $localSourceFile = "test/get_test.txt"; $remoteDestFile = "test.txt"; $uploadResult = WEB::$webdav->put_file($server, $localSourceFile, $remoteDestFile, false); echo $uploadResult . "\n"; // Pause sleep(4); // Example 1: Remove file echo "\n\nExample 1: Remove file\n"; echo "3. Remove file: "; $removeResult = WEB::$webdav->remove_file($server, $remoteDestFile); echo $removeResult . "\n"; // Step: Disconnect from all servers echo "4. Disconnect from all servers: "; $disconnectResult = WEB::$webdav->disconnect_all(); echo $disconnectResult . "\n"; // End echo "\n"; // Quit the application WINDOW::$app->quit();
# Additional paths import sys sys.path.insert(0, '../../../Templates PY/') xhe_host = "127.0.0.1:7035" from xweb_human_emulator import * # начало echo("<hr><font color=blue>ftp.xxxxxxxxx</font><hr>") # аккаунт server = "https://webdav.yandex.ru"; login = "xxx@yandex.ru"; password = "xxx"; # 1 echo("1. Соединится с сервером : "+server+" : "); echo(webdav.connect(server,login,password),"<br>"); # 2 echo("2. Запишем на фтп файл : ") echo(webdav.put_file(server,"test\\get_test.txt","test.txt",false),"<br>") # пауза sleep(4) # 3 echo("3. Удалим файл : ") echo(webdav.remove_file(server,"test.txt"),"<br>") # 4 echo("4. Отсоединится от всех : ") echo(webdav.disconnect_all()) # конец echo("<hr><br>") # Quit app.quit()
#region using using System; using System.Diagnostics; using System.Collections.Generic; using System.Linq; using System.IO; using System.Text; using System.Threading; using XHE; using XHE.XHE_DOM; using XHE.XHE_System; using XHE.XHE_Window; using XHE.XHE_Web; #endregion class Program:XHEScript { static void Main(string[] args) { // init XHE XHEScript.server = Environment.GetEnvironmentVariable("RPABOT_HOST_URL"); InitXHE(); // начало echo("<hr><font color=blue>ftp.remove_file</font><hr>"); // аккаунт var server = "https://webdav.yandex.ru"; var login = "xxx@yandex.ru"; var password = "xxx"; // 1 echo("1. Соединится с сервером : "+server+" : "); echo(webdav.connect(server,login,password)+"<br>"); // 2 echo("2. Запишем файл : "); echo(webdav.put_file(server,"test\\get_test.txt","test.txt",false)+"<br>"); // пауза sleep(4); // 3 echo("3. Удалим файл : "); echo(webdav.remove_file(server,"test.txt")+"<br>"); // 4 echo("4. Отсоединится от всех серверов : "); echo(webdav.disconnect_all()); // конец echo("\n\n"); app.quit(); } }
// подключим функциональные объекты, если еще не подключен xhe_host="127.0.0.1:7028"; echo=require("../../../Templates JS/init.js"); // начало echo("<hr><font color=blue>ftp.remove_file</font><hr>"); // аккаунт server = "https://webdav.yandex.ru"; login = "xxx@yandex.ru"; password = "xxx"; // 1 echo("1. Соединится с сервером : "+server+" : "); echo(webdav.connect(server,login,password)+"<br>"); // 2 echo("2. Запишем файл : "); echo(webdav.put_file(server,"test\\get_test.txt","test.txt",false)+"<br>"); // пауза app.sleep(4); // 3 echo("3. Удалим файл : "); echo(webdav.remove_file(server,"test.txt")+"<br>"); // 4 echo("4. Отсоединится от всех серверов : "); echo(webdav.disconnect_all()); // конец echo("\n"); // Quit app.quit();
=============================================
webdav Объекты DOM System Vision Web Window
=============================================
если что-то непонятно или необходимо узнать или считаете что надо добавить по работе этой функции, пишите в комментарии или на наш форум
.