Forums / Developer / Adding file in Exponential

"Please Note:
  • At the specific request of Ibexa we are changing this projects name to "Exponential" or "Exponential (CMS)" effective as of August, 11th 2025.
  • This project is not associated with the original eZ Publish software or its original developer, eZ Systems or Ibexa".

Adding file in Exponential

Author Message

Michaël Todorovic

Friday 09 January 2009 7:29:14 am

Hello,
I'm new to Exponential and I would like to allow my users to upload files with FTP (Exponential webdav isn't as fast as ftp). When a user sends a file to ftp, I would like to publish it in the according folder (like in webdav). The file arrival detection is done with inotify calling a php script (via cli). Which part of ezcomponents/Exponential should I use ?
I think I should use the part of ezdhtml which does upload but don't know where it is located.

Thank you,
Best regards,
Michaël

Björn X

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

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 Exponential 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 Exponential file is overwritten too. If I delete a FTP file, Exponential 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.