Reading FTP from Apache Module

I have to write a web service which downloads data from an FTP site.

My plan is to implement the service as an Apache module which will run on both Apache for Linux and Apache for Win32.

Before I go looking for a portable FTP library I was curious if anyone knew if there was a way to do this with either the apr library of another Apache module providing the FTP client access (perhaps some sort of proxy module).

mod_ftp provides FTP server functions so I am kind of looking for the opposite (FTP over HTTP rather than HTTP over FTP).
gazillabyteAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Dave BaldwinFixer of ProblemsCommented:
I'm confused about what is where.  You have to write a web service which runs on Apache.  Where is the FTP site?  What programming language are you intending to use?  PHP and cURL can both do that without writing a separate FTP module.
0
Dave BaldwinFixer of ProblemsCommented:
Also, it is FTP or HTTP but not one over the other.  All the browsers I know of have a basic FTP client built into them in addition to the obvious HTTP(s).
0
gazillabyteAuthor Commented:
I'm confused about what is where.  You have to write a web service which runs on Apache.  Where is the FTP site?  What programming language are you intending to use?  PHP and cURL can both do that without writing a separate FTP module.

The FTP site is not on the machine where the Apache module is running.

I am writing the module in C.

I would rather not use libcurl.

As I asked originally, does anyone know if this can be done with the apr library, or by using the services of another Apache module?
0
Become a CompTIA Certified Healthcare IT Tech

This course will help prep you to earn the CompTIA Healthcare IT Technician certification showing that you have the knowledge and skills needed to succeed in installing, managing, and troubleshooting IT systems in medical and clinical settings.

AlexPaceCommented:
Why don't you just use a scriptable FTP client like WinSCP and if WinSCP doesn't have enough scripting power you could step up to Robo-FTP but, as far as I know that only runs on Windows.

Anyway, FWIW, just make sure you are not stuck in a situation where the only tool you have is a hammer so ever solution looks like a nail.
0
gazillabyteAuthor Commented:
Alex

Seriously, if you don't know the answer, there's no need to change the question.

I'm looking for something that runs on Windows, Linux and z/OS. Does WinSCP run on z/OS?
0
skullnobrainsCommented:
mod_ftp provides FTP server functions so I am kind of looking for the opposite (FTP over HTTP rather than HTTP over FTP).

not sure this fits your need but can you configure your clients to use apache as a proxy ? if so apache antively supports FTP over HTTP (using mod_proxy, of course)

----

you can always also mount an ftp drive and serve it using apache. this is trivial to do both in windows and linux and i'd assume on z/OS as well
0
gazillabyteAuthor Commented:
Thanks for your reply.

I can't find any documentation that allows mod_proxy to serve a remote FTP server via HTTP.
0
skullnobrainsCommented:
as far as i remember it is enabled by default and you'd need to add restrictions if you want to disable it. just make sure mod_proxy and mod_proxy_ftp are present and refer to the documentation of mod_proxy to enable the proxy and disable HTTP and HTTPS support if you don't want them

note that the ftp proxy only handles download (which i assume is ok given the question)

- configure the client to use an http proxy for all protocols including ftp or for ftp only
- the client will send something like "GET ftp://...\n\n"
- and the proxy will answer with the contents

---

if you don't want to configure stuff in the client, you can alternatively use something like this

proxypass / ftp://FTPserver/pathx/

which will let you download files from an ftp server using a regular http URL

if the client connects to http://yourserver/path/file.txt
he will download ftp://FTPserver/pathx/path/file.txt
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Linux OS Dev

From novice to tech pro — start learning today.