FTP Help
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsSystem AdministrationFTP Help

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old June 2nd, 2003, 03:14 AM
bonechair's Avatar
bonechair bonechair is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Apr 2001
Location: Cape Town
Posts: 477 bonechair User rank is Corporal (100 - 500 Reputation Level)bonechair User rank is Corporal (100 - 500 Reputation Level)bonechair User rank is Corporal (100 - 500 Reputation Level)bonechair User rank is Corporal (100 - 500 Reputation Level) 
Time spent in forums: 10 h 22 m 42 sec
Reputation Power: 10
Talking Use php to tftp

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

Reply With Quote
  #2  
Old June 2nd, 2003, 03:38 AM
AlCapone's Avatar
AlCapone AlCapone is offline
Mobbing Gangster
Dev Shed Demi-God (4500 - 4999 posts)
 
Join Date: Sep 2001
Location: "Best City" 2002 and 2003- Melbourne, Australia
Posts: 4,913 AlCapone User rank is Sergeant (500 - 2000 Reputation Level)AlCapone User rank is Sergeant (500 - 2000 Reputation Level)AlCapone User rank is Sergeant (500 - 2000 Reputation Level)AlCapone User rank is Sergeant (500 - 2000 Reputation Level)AlCapone User rank is Sergeant (500 - 2000 Reputation Level) 
Time spent in forums: 5 h 36 m 31 sec
Reputation Power: 18
Send a message via ICQ to AlCapone Send a message via AIM to AlCapone Send a message via Yahoo to AlCapone
You can if you got --enable-ftp www.php.net/ftp

Reply With Quote
  #3  
Old June 2nd, 2003, 03:51 AM
bonechair's Avatar
bonechair bonechair is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Apr 2001
Location: Cape Town
Posts: 477 bonechair User rank is Corporal (100 - 500 Reputation Level)bonechair User rank is Corporal (100 - 500 Reputation Level)bonechair User rank is Corporal (100 - 500 Reputation Level)bonechair User rank is Corporal (100 - 500 Reputation Level) 
Time spent in forums: 10 h 22 m 42 sec
Reputation Power: 10
Red face tftp

Im am asking about tftp not ftp, will that work with tftp?

Reply With Quote
  #4  
Old June 2nd, 2003, 03:59 AM
AlCapone's Avatar
AlCapone AlCapone is offline
Mobbing Gangster
Dev Shed Demi-God (4500 - 4999 posts)
 
Join Date: Sep 2001
Location: "Best City" 2002 and 2003- Melbourne, Australia
Posts: 4,913 AlCapone User rank is Sergeant (500 - 2000 Reputation Level)AlCapone User rank is Sergeant (500 - 2000 Reputation Level)AlCapone User rank is Sergeant (500 - 2000 Reputation Level)AlCapone User rank is Sergeant (500 - 2000 Reputation Level)AlCapone User rank is Sergeant (500 - 2000 Reputation Level) 
Time spent in forums: 5 h 36 m 31 sec
Reputation Power: 18
Send a message via ICQ to AlCapone Send a message via AIM to AlCapone Send a message via Yahoo to AlCapone
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

Reply With Quote
  #5  
Old June 2nd, 2003, 04:39 AM
bonechair's Avatar
bonechair bonechair is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Apr 2001
Location: Cape Town
Posts: 477 bonechair User rank is Corporal (100 - 500 Reputation Level)bonechair User rank is Corporal (100 - 500 Reputation Level)bonechair User rank is Corporal (100 - 500 Reputation Level)bonechair User rank is Corporal (100 - 500 Reputation Level) 
Time spent in forums: 10 h 22 m 42 sec
Reputation Power: 10
Thank you very much sir

Will look into that

Reply With Quote
  #6  
Old June 2nd, 2003, 05:29 AM
sankyu sankyu is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Mar 2003
Posts: 38 sankyu User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 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

Reply With Quote
  #7  
Old November 22nd, 2004, 02:35 PM
mgandalf mgandalf is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Nov 2004
Posts: 1 mgandalf User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
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

Reply With Quote
Reply

Viewing: Dev Shed ForumsSystem AdministrationFTP Help > Use php to tftp


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 3 hosted by Hostway