PHP, cURL and FTP

Posted by Mattias Sandström on March 19, 2009

A new acquaintance for me in PHP is the cURL library that caught my attention when I was doing some export (HTTPS upload) functions. cURL provided me with an easy to use library that did all of the heavy weight-lifting when communicating with the remote server. Instead of using the file functions (fopen() et al) and follow the HTTP protocol to pass data, I could focus on the actual problem itself and trust cURL to transmit the data to the server.

Just recently I completed another import project where data was to be fetched from a remote FTP-server, downloaded and parsed. After the parsing the parsed files were to be moved to another directory. I knew of the FTP-module in PHP back in PHP4 but never got it to run properly on my Windows system. In PHP5 everything just worked out of the box - no re-compile or additional installs! Thanks to the FTP module in PHP this project was also completed ahead of time!

Links for references:
http://www.php.net/manual/en/book.curl.php
http://www.php.net/manual/en/book.ftp.php

 
 
 

Copyright © 2005-2012 Tangix Design & Development. All rights reserved