Adding file in ezpublish

Author Message

Michaël Todorovic

Friday 09 January 2009 7:29:14 am

Hello,
I'm new to ezPublish and I would like to allow my users to upload files with FTP (ezpublish 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/ezpublish 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 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.

Powered by eZ Publish™ CMS Open Source Web Content Management. Copyright © 1999-2014 eZ Systems AS (except where otherwise noted). All rights reserved.

eZ debug

Timing: Jan 18 2025 11:30:34
Script start
Timing: Jan 18 2025 11:30:34
Module start 'layout'
Timing: Jan 18 2025 11:30:34
Module start 'content'
Timing: Jan 18 2025 11:30:34
Module end 'content'
Timing: Jan 18 2025 11:30:34
Script end

Main resources:

Total runtime0.7391 sec
Peak memory usage4,096.0000 KB
Database Queries57

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0047 587.9141152.6250
Module start 'layout' 0.00470.0037 740.539139.4453
Module start 'content' 0.00840.7291 779.9844533.6797
Module end 'content' 0.73750.0015 1,313.664112.1641
Script end 0.7390  1,325.8281 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00340.4634160.0002
Check MTime0.00160.2108160.0001
Mysql Total
Database connection0.00060.074810.0006
Mysqli_queries0.694093.8989570.0122
Looping result0.00050.0728550.0000
Template Total0.708995.920.3545
Template load0.00210.279920.0010
Template processing0.706895.639120.3534
Template load and register function0.00020.031910.0002
states
state_id_array0.00090.122710.0009
state_identifier_array0.00110.153520.0006
Override
Cache load0.00170.2264180.0001
Sytem overhead
Fetch class attribute can translate value0.00090.126920.0005
Fetch class attribute name0.00170.227840.0004
XML
Image XML parsing0.00050.073620.0003
class_abstraction
Instantiating content class attribute0.00000.001340.0000
General
dbfile0.00090.1199160.0001
String conversion0.00000.001340.0000
Note: percentages do not add up to 100% because some accumulators overlap

Templates used to render the page:

UsageRequested templateTemplateTemplate loadedEditOverride
1node/view/full.tplfull/forum_topic.tplextension/sevenx/design/simple/override/templates/full/forum_topic.tplEdit templateOverride template
3content/datatype/view/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
3content/datatype/view/ezxmltags/line.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/line.tplEdit templateOverride template
4content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
1content/datatype/view/ezimage.tpl<No override>extension/sevenx/design/simple/templates/content/datatype/view/ezimage.tplEdit templateOverride template
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_pagelayout.tplEdit templateOverride template
 Number of times templates used: 13
 Number of unique templates used: 6

Time used to render debug report: 0.0001 secs