|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
||||
|
||||
|
Hi
The linux router here uses tftp to transfer files. What I wanna know is, can I write a script in php to automatically transfer a file... example tftp: tftp 122.22.22.1 bi put file.tgz quit That puts a file on another computer that has tftp server running.. Can I do this with php? If not with what? I have tried with a shell script.. Kindest Louis
__________________
http://www.capeseo.com |
|
#2
|
||||
|
||||
|
You can if you got --enable-ftp www.php.net/ftp
|
|
#3
|
||||
|
||||
|
Im am asking about tftp not ftp, will that work with tftp?
|
|
#4
|
||||
|
||||
|
ah sorry about that man - got all confused here
I guess in your case the best solution would be to use perl NET::TFTP or TFTP modules for this |
|
#5
|
||||
|
||||
|
Thank you very much sir
Will look into that |
|
#6
|
|||
|
|||
|
You could also create your own function with the socket functions build in PHP.
a basic tutorial on using sockets in php can be found here; http://www.phpfreaks.com/tutorials/50/0.php It is however like plainly opening a telnet session to the service port, so you will have to know the protocol (commands, formats, etc) which might take you some time to read up on. Fun thing to write though.
__________________
Windows 2000 SP4 Apache v2.0.44 PHP v4.3.1 MySQL v3.23.55 |
|
#7
|
|||
|
|||
|
Hoe to transfer files by PHP via TFTP to router
Hi, it is quite simple, don't use TFTP directly but you can use SNMP to do it for you. Only what you need is running tftp server and get necessary MIB object numbers. I do this on Cisco routers and if you to, these urls should be usefull:
Enjoy http://tools.cisco.com/Support/SNMP/do/BrowseOID.do?local=en&translate=Translate&objectInput=1.3.6.1 http://www.cisco.com/warp/public/477/SNMP/11_7910.shtml |
![]() |
| Viewing: Dev Shed Forums > System Administration > FTP Help > Use php to tftp |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|