SQLI Import - How to Import file

Author Message

Nicolas Panau

Tuesday 24 May 2011 2:40:22 am

Hi eZ Community,

I'm using sqliimport to manage content import (great extension btw), but i'm stuck on importing files (or images).
I simply don't get how to use $object->fields->  to import my file. Every other content or dataype is OK.

I succeed by using createAndPublish, and by setting ['storage-dir'], but I didn't find a way to set a storage-dir with sqliimport methods (an option in SQLIContent::create ?), and passing the entire path like $object->fields->myfile->'path/to/my/file/file/pdf' didn't work.

Any clue?

Thanks

www.umanit.fr

Jérôme Vieilledent

Tuesday 24 May 2011 5:29:52 am

Hi Nicolas

You need to pass the real path (absolute) on your server, e.g. /var/www/myimagedir/myImage.jpg (same for binary files.

It's easy to get with realpath() PHP function.

Nicolas Panau

Tuesday 24 May 2011 6:42:33 am

Hi Jérôme,

Thanks, it works... can't believe I missed that! I was indeed passing the relative path.

Cheers!

www.umanit.fr

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 02:49:41
Script start
Timing: Jan 18 2025 02:49:41
Module start 'layout'
Timing: Jan 18 2025 02:49:41
Module start 'content'
Timing: Jan 18 2025 02:49:41
Module end 'content'
Timing: Jan 18 2025 02:49:41
Script end

Main resources:

Total runtime0.6408 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.0059 589.0469152.6250
Module start 'layout' 0.00590.0034 741.671939.4531
Module start 'content' 0.00940.6299 781.1250548.1016
Module end 'content' 0.63920.0015 1,329.226612.1563
Script end 0.6408  1,341.3828 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00330.5152160.0002
Check MTime0.00130.2049160.0001
Mysql Total
Database connection0.00090.142910.0009
Mysqli_queries0.587391.6486570.0103
Looping result0.00060.0894550.0000
Template Total0.606294.620.3031
Template load0.00190.295120.0009
Template processing0.604394.304120.3022
Template load and register function0.00010.016710.0001
states
state_id_array0.00260.406410.0026
state_identifier_array0.00110.164620.0005
Override
Cache load0.00150.2399240.0001
Sytem overhead
Fetch class attribute can translate value0.00080.130420.0004
Fetch class attribute name0.00150.229150.0003
XML
Image XML parsing0.00110.165320.0005
class_abstraction
Instantiating content class attribute0.00000.002460.0000
General
dbfile0.00100.1537230.0000
String conversion0.00000.001940.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/ezimage.tpl<No override>extension/sevenx/design/simple/templates/content/datatype/view/ezimage.tplEdit templateOverride template
3content/datatype/view/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
6content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
1content/datatype/view/ezxmltags/line.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/line.tplEdit templateOverride template
3content/datatype/view/ezxmltags/emphasize.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/emphasize.tplEdit templateOverride template
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_pagelayout.tplEdit templateOverride template
 Number of times templates used: 18
 Number of unique templates used: 7

Time used to render debug report: 0.0002 secs