1. Go to this page and download the library: Download voipforall/tftp-client 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/ */
voipforall / tftp-client example snippets
use VoIPforAll\TFTPClient\TFTPClient;
$client = new TFTPClient;
$response = $client->put('path/to/your/file-to-send.txt');
dd($response) -> true
use VoIPforAll\TFTPClient\TFTPClient;
$client = new TFTPClient;
$content = $client->get('file-to-download.txt');
dd($content) -> "Download Ok"
/*
|--------------------------------------------------------------------------
| Default TFTP Connection Name
|--------------------------------------------------------------------------
|
| Here you may specify which of the TFTP connections below you wish
| to use as your default connection for all TFTP operations. Of
| course you may add as many connections you'd like below.
|
*/
'connection' => env('TFTP_CLIENT_CONNECTION', 'default'),
/*
|--------------------------------------------------------------------------
| TFTP Connections
|--------------------------------------------------------------------------
|
| Below you may configure each TFTP connection your application
/*
|--------------------------------------------------------------------------
| TFTP Logging
|--------------------------------------------------------------------------
|
| When TFTP_LOGGING is enabled, all connections and transfers
| operations are logged using the application logging
| driver selected in TFTP_LOGGER_CHANNEL. This
| can assist in debugging issues and more.
|
*/
'logging' => env('TFTP_LOGGING', false),
'logger_channel' => env('TFTP_LOGGER_CHANNEL', env('LOG_CHANNEL')),