|
|
 |
Re: FN-FORUM: Suggestions please
date posted 30th January 2006 11:07
[EMAIL REMOVED] wrote:
> I am after a job where there will be csv files on a ftp server that
> will need uploading to a database once a day and I am trying to work
> out the best way to do it. I gather you need "allow_url_fopen = On"
> set in php.ini to be able to use the ftpwrapper. Is it likely to be
> set to on? It should be in php as far as I know unless they change
> their mind. I was wondering about setting up a cron job to do it. Has
> anyone done anything similar as I am looking for pointers in the
> right direction?
This doesn't seem to be a web-based task, so PHP would be a slightly
strange choice of technology. I know that it's possible to write command
line programs in PHP, but you very rarely hear of it being done.
Personally I'd write a Perl program that connects to the FTP server,
downloads the files and inserts the data into the database. I'd then set
up a cronjob that executed that program every day.
Of course, it doesn't have to be Perl. Any programming language would be
suitable as long as it has support for accessing FTP servers and
databases. You could even do it in a Unix shell script as long as you
don't mind using external programs for the FTP and database bits.
Dave...
--
Magnum Solutions Ltd
Open Source Consultancy, Development and Training
|
 |
|