ameliabob Posted October 9, 2012 Share Posted October 9, 2012 I am just starting to use FTP to get files from the server to the user. In what I am reading it is saying that I need to connect to the server. but I am the server and just sending a file. What am I missing here? thanks Link to comment Share on other sites More sharing options...
birbal Posted October 9, 2012 Share Posted October 9, 2012 (edited) FTP server are different from web server. when we handle mysql database we made connection to mysql server which is also seperate server running on the machine. we talk to that server with the specific port the server are bound to listen. opening socket on specific port and connecting it is that what php do. so in that case php is client which is connection to the mysql server. same happens with FTP. to be more elaborate, if FTP and MYSQL is is installed an running with php as module of apache, there is three server is running on. when user request apache got listen to the web port. it runs a php instance handle the php file make opcodes,executes it. when php files are getting executed they create socket on port and connect to respective running servers, recievs the response back to php and php handle the request and serve out the page. Edited October 9, 2012 by birbal Link to comment Share on other sites More sharing options...
ameliabob Posted October 9, 2012 Author Share Posted October 9, 2012 That was way too much information in way to few lines. I am loooking for a snippet of code resident on the server that would prepare a file and send it to the user. The user would only be sending a request to the server to prepare and send it. Any place where I can find such code? Link to comment Share on other sites More sharing options...
thescientist Posted October 9, 2012 Share Posted October 9, 2012 How exactly are you expecting to send this file to the user? Do they have an FTP server setup? Perhaps you should familiarize yourself with FTP first.http://en.wikipedia.org/wiki/File_Transfer_Protocol Link to comment Share on other sites More sharing options...
justsomeguy Posted October 9, 2012 Share Posted October 9, 2012 I am loooking for a snippet of code resident on the server that would prepare a file and send it to the user. The user would only be sending a request to the server to prepare and send it.How is that different than a regular hyperlink? You put a link on your page to the file to download, the user clicks it, their browser requests the file from the server, and the server sends it. How is what you're trying to do different than what browsers already do? Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now