image upload with powercontent

Author Message

Bherly Novrandy

Tuesday 24 February 2009 5:56:16 pm

i have a form with powercontent that use for uploading an image..

<form action={"index.php/powercontent/action"|ezroot} method="POST">
    	<input type="hidden" name="NodeID" value="{$module_result.view_parameters.nodeId}" />
		<input type="hidden" name="ClassIdentifier" value="article" />
        <label for='articleTitle'>Title</label>
        <input type='text' id='articleTitle' class='contact-input' name="powercontent_title_ContentObjectAttribute_ezstring_data_text_pcattributeid" />
		<input type="hidden" name="powercontent_author_ContentObjectAttribute_ezstring_data_text_pcattributeid" value="{$user.contentobject.name}" />
		<label>Summary</label>
        <textarea name="powercontent_short_description_ContentObjectAttribute_data_text_pcattributeid" rows="5" cols="30" class="contact-input"></textarea>
        <label for="comments">Body</label>
        <textarea name="powercontent_body_ContentObjectAttribute_data_text_pcattributeid" id="comments" rows="10" cols="60" class="contact-input"></textarea>
        <input type="hidden" name="DoPublish" value="yes" />
        <label for="upload">Upload Photo</label>
        <input type='file' id='upload' class='contact-input' name='powercontent_thumbnail_ContentObjectAttribute_ezimage_data_binaryfilename_pcattributeid' />
        <button type='submit' class='contact-send contact-button' name="CreateButton">Submit</button>
        <button type='reset' class='contact-send contact-button'>Reset</button>
        <br/>
        <p>
        <small>The picture file size should be less than 1 Mb (only support jpg, gif, png)</small>
        </p>
        <input type='hidden' name='token' value='""'/>
    </form>

everything else is update to article except the thumbnail... any suggestion? thx

meriam santos

Sunday 21 February 2010 5:13:00 pm

Hi there,Got a similar error. Just wondering if you were able to find a solution for this.thanks...

Pierandrea Della Putta

Monday 29 November 2010 1:38:15 am

To upload image with powercontent, just use "imagename" field in attribute name of tag input.

Example:

<input class="box" name="powercontent_photocommunity_image_ContentObjectAttribute_data_imagename_pcattributeid"  type="file" />

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

Main resources:

Total runtime0.7604 sec
Peak memory usage4,096.0000 KB
Database Queries59

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0050 587.9141152.6250
Module start 'layout' 0.00500.0042 740.539139.4609
Module start 'content' 0.00910.7496 780.0000538.7813
Module end 'content' 0.75870.0017 1,318.781312.1641
Script end 0.7604  1,330.9453 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00340.4415160.0002
Check MTime0.00140.1781160.0001
Mysql Total
Database connection0.00050.071810.0005
Mysqli_queries0.705292.7352590.0120
Looping result0.00070.0976570.0000
Template Total0.724595.320.3622
Template load0.00240.317220.0012
Template processing0.722094.955520.3610
Template load and register function0.00020.031310.0002
states
state_id_array0.00160.208410.0016
state_identifier_array0.00120.153920.0006
Override
Cache load0.00210.2754130.0002
Sytem overhead
Fetch class attribute can translate value0.00080.107830.0003
Fetch class attribute name0.00210.279640.0005
XML
Image XML parsing0.00130.168630.0004
class_abstraction
Instantiating content class attribute0.00000.001340.0000
General
dbfile0.00110.1399160.0001
String conversion0.00000.001740.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
4content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
2content/datatype/view/ezxmltags/literal.tpl<No override>extension/community/design/standard/templates/content/datatype/view/ezxmltags/literal.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: 12
 Number of unique templates used: 6

Time used to render debug report: 0.0001 secs