Szukam przykładu w PHP (na socketach) jak wysłać plik do serwera tftp.
(przykład jak ściągnąć plik z serwera tftp mam)
PS.
może ktoś wie jak przerobić ten przykład:
(funkcja pobiera plik z tftp)
<?php function tftp_fetch($host, $filename) { $socket = socket_create(AF_INET, SOCK_DGRAM, SOL_UDP); // create the request packet $packet = chr(0) . chr(1) . $filename . chr(0) . 'octet' . chr(0); // UDP is connectionless, so we just send on it. $buffer = ''; $port = ''; $ret = ''; do { // $buffer and $port both come back with information for the ack // 516 = 4 bytes for the header + 512 bytes of data socket_recvfrom($socket, $buffer, 516, 0, $host, $port); // add the block number from the data packet to the ack packet // send ack // append the data to the return variable // for large files this function should take a file handle as an arg } return $ret; } ?>