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: Feb 16 2025 07:15:07
Script start
Timing: Feb 16 2025 07:15:07
Module start 'layout'
Timing: Feb 16 2025 07:15:07
Module start 'content'
Timing: Feb 16 2025 07:15:07
Module end 'content'
Timing: Feb 16 2025 07:15:07
Script end

Main resources:

Total runtime0.0160 sec
Peak memory usage2,048.0000 KB
Database Queries3

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0047 592.7266151.2031
Module start 'layout' 0.00470.0023 743.929736.6641
Module start 'content' 0.00700.0071 780.593890.1719
Module end 'content' 0.01410.0018 870.765633.9922
Script end 0.0160  904.7578 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.002817.4636140.0002
Check MTime0.00148.9614140.0001
Mysql Total
Database connection0.00084.832510.0008
Mysqli_queries0.002213.871330.0007
Looping result0.00000.050710.0000
Template Total0.00148.710.0014
Template load0.00116.940110.0011
Template processing0.00031.718610.0003
Override
Cache load0.00074.644610.0007
General
dbfile0.002918.141880.0004
String conversion0.00000.031340.0000
Note: percentages do not add up to 100% because some accumulators overlap

Templates used to render the page:

UsageRequested templateTemplateTemplate loadedEditOverride
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_pagelayout.tplEdit templateOverride template
 Number of times templates used: 1
 Number of unique templates used: 1

Time used to render debug report: 0.0001 secs