web based ftp...

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
Illusionist
Forum Regular
Posts: 903
Joined: Mon Jan 12, 2004 9:32 pm

web based ftp...

Post by Illusionist »

before i get into my next project, there are a few questions, well one really, that i need answered.

My school blocks almost ALL ports. So i have no ftp access, or anything. The only ports they open are 80 and a few others for the boarders that play games. Other than that they block all others. I was wodnering though, would it be possible to create a php application with ftp commands to connect to my local ftp server and access it from my picky school? This question may/may not make much sense, but hopefully someone may understand it and can give me a reasonable answer!
Thanks
TheBentinel.com
Forum Contributor
Posts: 282
Joined: Wed Mar 10, 2004 1:52 pm
Location: Columbus, Ohio

Post by TheBentinel.com »

You'd need to have your PHP script download/upload the files to your server, then send them on to the target server, so it won't be exactly like FTP, but yeah, you could do it. You'd probably have to handle all the FTP stuff yourself with sockets. PHP doesn't have native FTP support, does it?
Illusionist
Forum Regular
Posts: 903
Joined: Mon Jan 12, 2004 9:32 pm

Post by Illusionist »

http://www.php.net/ftp

and why would i have to download/upload anything?? That doesn't make sense...
TheBentinel.com
Forum Contributor
Posts: 282
Joined: Wed Mar 10, 2004 1:52 pm
Location: Columbus, Ohio

Post by TheBentinel.com »

That's incredible, PHP just doesn't stop impressing me. Kicks ASP's butt all day long.

You're behind a firewall that's only allowing you port 80 access. So you can get out to your web server, but that's it. Your web server can get to your FTP server. So you need to create a web system that lets you remotely manipulate the FTP session you create in PHP.

You <--> Your Web Server <--> Your FTP server

to get a file from your FTP server, you need to first bring it to your web server (FTP get), then send it to You (via HTTP download)

To send a file to the FTP server, the opposite: Upload it via HTTP to your webserver, then send it on to the FTP server via put.

I assume your FTP server and your web server are different machines. If your FTP server and your web server are the same machine, then you don't need FTP at all, do you?
magicrobotmonkey
Forum Regular
Posts: 888
Joined: Sun Mar 21, 2004 1:09 pm
Location: Cambridge, MA

Post by magicrobotmonkey »

another thing - depending on what kind of access you have to your web server or even your FTP machine, you can easily change the ports. They're not set in stone you know! Change the ftp server to listen on port 80 and then from your machine: ftp://host:80
simple!
kettle_drum
DevNet Resident
Posts: 1150
Joined: Sun Jul 20, 2003 9:25 pm
Location: West Yorkshire, England

Post by kettle_drum »

Or you could run a bouncer on your home computer so it connects you through to where you really want to go. Or run php shell. Or infact just have telnet or ssh listen on port 80 and connect to that from school.
magicrobotmonkey
Forum Regular
Posts: 888
Joined: Sun Mar 21, 2004 1:09 pm
Location: Cambridge, MA

Post by magicrobotmonkey »

Yea, ive been behind blocked ports before and its always a good time trying to hook up to all the services i wanted! For a REAL good time, try hosting a site over DSL with a dynamic IP and port 80 blocked!
Post Reply