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 August 26th, 2004, 02:33 PM
Antixat Antixat is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jun 2003
Posts: 224 Antixat User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 17 h 27 m 18 sec
Reputation Power: 6
Send a message via MSN to Antixat
Raw CMD: PORT.. whade****?

well im having some probs with using ftp_nlist in php so I thought I did it manually using fsockopen..

I tried using LIST but that didnt return much without having done the PORT command first, now I got this explenation from a site on how to use PORT:

Quote:
PORTSyntax: PORT a1,a2,a3,a4,p1,p2
Specifies the host and port to which the server should connect for the next file transfer. This is interpreted as IP address a1.a2.a3.a4, port p1*256+p2.


now I understand the ip stuff but the port? p1 and p2? looks like there are 2 ports in the game??

could someone explain how this works please?

Reply With Quote
  #2  
Old August 26th, 2004, 07:40 PM
LaughingBelly's Avatar
LaughingBelly LaughingBelly is offline
Who set my Title?
Dev Shed Novice (500 - 999 posts)
 
Join Date: Jun 2004
Posts: 528 LaughingBelly User rank is First Lieutenant (10000 - 20000 Reputation Level)LaughingBelly User rank is First Lieutenant (10000 - 20000 Reputation Level)LaughingBelly User rank is First Lieutenant (10000 - 20000 Reputation Level)LaughingBelly User rank is First Lieutenant (10000 - 20000 Reputation Level)LaughingBelly User rank is First Lieutenant (10000 - 20000 Reputation Level)LaughingBelly User rank is First Lieutenant (10000 - 20000 Reputation Level)LaughingBelly User rank is First Lieutenant (10000 - 20000 Reputation Level)LaughingBelly User rank is First Lieutenant (10000 - 20000 Reputation Level) 
Time spent in forums: 2 Weeks 1 Day 5 h 30 m 59 sec
Reputation Power: 204
It is one port. The port is represented as two parts. if you have a port 1000, it is represented as individual bytes. 1000/256, 1000%256. that would be 3, 232. so p1=3 and p2=232. ask again if you dont understand.

Reply With Quote
  #3  
Old August 27th, 2004, 12:23 PM
Antixat Antixat is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jun 2003
Posts: 224 Antixat User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 17 h 27 m 18 sec
Reputation Power: 6
Send a message via MSN to Antixat
1000/256 = 3.9..

1000%256.. ermm.. whats '%' supposed to represent?

I was never really good at math

and how would I know what port to use for the PORT cmd?

Reply With Quote
  #4  
Old August 27th, 2004, 03:43 PM
LaughingBelly's Avatar
LaughingBelly LaughingBelly is offline
Who set my Title?
Dev Shed Novice (500 - 999 posts)
 
Join Date: Jun 2004
Posts: 528 LaughingBelly User rank is First Lieutenant (10000 - 20000 Reputation Level)LaughingBelly User rank is First Lieutenant (10000 - 20000 Reputation Level)LaughingBelly User rank is First Lieutenant (10000 - 20000 Reputation Level)LaughingBelly User rank is First Lieutenant (10000 - 20000 Reputation Level)LaughingBelly User rank is First Lieutenant (10000 - 20000 Reputation Level)LaughingBelly User rank is First Lieutenant (10000 - 20000 Reputation Level)LaughingBelly User rank is First Lieutenant (10000 - 20000 Reputation Level)LaughingBelly User rank is First Lieutenant (10000 - 20000 Reputation Level) 
Time spent in forums: 2 Weeks 1 Day 5 h 30 m 59 sec
Reputation Power: 204
Err, i should have said that the first one is integer division

So 1000/256 = 3

% is the remainder operator or modulus operator

When you divide 1000/256, you get 3 as quotient and 232 as remainder.

You can pick whatever port you could bind to for the PORT command. Its the port you know you can receive data on. when the server sees this command, its going to connect to that port when you request a file to be uploaded or downloaded.

Reply With Quote
Reply

Viewing: Dev Shed ForumsSystem AdministrationFTP Help > Raw CMD: PORT.. whade****?


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 6 hosted by Hostway
Stay green...Green IT