upload image in attribute

Author Message

Joël LEGER

Thursday 24 September 2009 1:57:05 am

Hi,

i'm fighting for inserting an uploaded image as an attribute :

$result = array( 'errors' => array() );
$upload = new eZContentUpload();
if($upload->handleUpload( $result, 'image', object.main_node_id, object.main_node_id )){
		
   $datamap['image']->fromString($result['result']['path']);
  $datamap['image']->store();
}

 

it create an object image under my object , actually i would like the same feature as a class with datatype image.

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:25:21
Script start
Timing: Jan 18 2025 11:25:21
Module start 'layout'
Timing: Jan 18 2025 11:25:21
Module start 'content'
Timing: Jan 18 2025 11:25:22
Module end 'content'
Timing: Jan 18 2025 11:25:22
Script end

Main resources:

Total runtime0.7923 sec
Peak memory usage4,096.0000 KB
Database Queries46

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0074 587.9219152.6250
Module start 'layout' 0.00740.0040 740.546939.4453
Module start 'content' 0.01130.7795 779.9922399.9063
Module end 'content' 0.79080.0014 1,179.89848.1641
Script end 0.7922  1,188.0625 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00340.4346160.0002
Check MTime0.00130.1689160.0001
Mysql Total
Database connection0.00140.172210.0014
Mysqli_queries0.748294.4378460.0163
Looping result0.00050.0580440.0000
Template Total0.754295.220.3771
Template load0.00260.329020.0013
Template processing0.751694.866020.3758
Template load and register function0.00030.039810.0003
states
state_id_array0.00090.117510.0009
state_identifier_array0.00100.129120.0005
Override
Cache load0.00200.257180.0003
Sytem overhead
Fetch class attribute can translate value0.00130.169610.0013
Fetch class attribute name0.00080.098210.0008
XML
Image XML parsing0.00020.030710.0002
class_abstraction
Instantiating content class attribute0.00000.000510.0000
General
dbfile0.00080.0974100.0001
String conversion0.00000.001540.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
1content/datatype/view/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
2content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
1content/datatype/view/ezxmltags/literal.tpl<No override>extension/community/design/standard/templates/content/datatype/view/ezxmltags/literal.tplEdit templateOverride template
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_pagelayout.tplEdit templateOverride template
 Number of times templates used: 6
 Number of unique templates used: 5

Time used to render debug report: 0.0002 secs