Share » Forums » Developer » Adding file in ezpublish

Adding file in ezpublish

Adding file in ezpublish

Friday 09 January 2009 7:29:14 am - 2 replies

Author Message

Björn Dieding@xrow.de

Friday 09 January 2009 8:49:13 am

just to throw your attention on this one. i do not knwo if it works. I have never used it.

http://projects.ez.no/ezftp

Looking for a new job? http://www.xrow.com/xrow-GmbH/Jobs
Looking for hosting? http://hostingezpublish.com
-----------------------------------------------------------------------------
GMT +01:00 Hannover, Germany
Web: http://www.xrow.com/

Michaël Todorovic

Wednesday 21 January 2009 7:06:56 am

Ok, I have done it with part of ezftp. I tried ezftp extension but it consumes 100% CPU. I use vsftpd with a user chrooted in a special directory (i.e. /var/www/extranet/virtualFtp). In order to put files in the right node, I made a php script updateFtp.php (run by cron) which lists content structure menu and creates directories in /var/www/extranet/virtualFtp. A menu called "Marketing" will create a directory "marketing" in /var/www/extranet/virtualFtp.
Via ftp, a user will send a file in marketing (/var/www/extranet/virtualFtp/marketing). The file will automatically added in Marketing node. In a word, it works like ezpublish webdav. Now I will create a new trigger and workflow to call updateFtp.php when a new node is created in menu. It will avoid cron and its latency : I run the script once a day so if I change something, I have to wait next day or run the script by hand.

I empty FTP files to avoid space waste. If a FTP file is overwritten, the ezpublish file is overwritten too. If I delete a FTP file, ezpublish file is moved to trash. Every day, a script is run to delete permanently 7 days old files. FTP directories can't be deleted thanks to vsftpd configuration (RMD ftp command is forbidden).

This solution is much faster than ez's webdav and it works well for now.

You must be logged in to post messages in this topic!

36 542 Users on board!

Forums menu