I'm not exactly sure as to what your asking, but I did some pretty extensive work with perl and proftpd, to make it function as a filesystem of sort, using mod_sql for logging and archiving, and perl for the stored procs.
You can find more information at howtoforge.com --
my howtoforge tutorial
Evan Carroll
www.EvanCarroll.com