Forums / Setup & design / image upload with powercontent

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" />

eZ debug

Timing: Jan 18 2025 00:46:34
Script start
Timing: Jan 18 2025 00:46:34
Module start 'content'
Timing: Jan 18 2025 00:46:35
Module end 'content'
Timing: Jan 18 2025 00:46:35
Script end

Main resources:

Total runtime1.4232 sec
Peak memory usage4,096.0000 KB
Database Queries196

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0085 591.7266180.8359
Module start 'content' 0.00851.2915 772.5625543.8594
Module end 'content' 1.30000.1231 1,316.4219332.7813
Script end 1.4231  1,649.2031 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00440.3068210.0002
Check MTime0.00150.1068210.0001
Mysql Total
Database connection0.00140.100110.0014
Mysqli_queries1.347194.65281960.0069
Looping result0.00200.14401940.0000
Template Total1.386597.420.6933
Template load0.00270.190820.0014
Template processing1.383897.234120.6919
Template load and register function0.00020.014610.0002
states
state_id_array0.00110.078810.0011
state_identifier_array0.00130.094520.0007
Override
Cache load0.00210.1483130.0002
Sytem overhead
Fetch class attribute can translate value0.00190.131140.0005
Fetch class attribute name0.00180.123640.0004
XML
Image XML parsing0.00320.227540.0008
class_abstraction
Instantiating content class attribute0.00000.000640.0000
General
dbfile0.00410.2897270.0002
String conversion0.00000.000630.0000
Note: percentages do not add up to 100% because some accumulators overlap

CSS/JS files loaded with "ezjscPacker" during request:

CacheTypePacklevelSourceFiles
CSS0extension/community/design/community/stylesheets/ext/jquery.autocomplete.css
extension/community_design/design/suncana/stylesheets/scrollbars.css
extension/community_design/design/suncana/stylesheets/tabs.css
extension/community_design/design/suncana/stylesheets/roadmap.css
extension/community_design/design/suncana/stylesheets/content.css
extension/community_design/design/suncana/stylesheets/star-rating.css
extension/community_design/design/suncana/stylesheets/syntax_and_custom_tags.css
extension/community_design/design/suncana/stylesheets/buttons.css
extension/community_design/design/suncana/stylesheets/tweetbox.css
extension/community_design/design/suncana/stylesheets/jquery.fancybox-1.3.4.css
extension/bcsmoothgallery/design/standard/stylesheets/magnific-popup.css
extension/sevenx/design/simple/stylesheets/star_rating.css
extension/sevenx/design/simple/stylesheets/libs/fontawesome/css/all.min.css
extension/sevenx/design/simple/stylesheets/main.v02.css
extension/sevenx/design/simple/stylesheets/main.v02.res.css
JS0extension/ezjscore/design/standard/lib/yui/3.17.2/build/yui/yui-min.js
extension/ezjscore/design/standard/javascript/jquery-3.7.0.min.js
extension/community_design/design/suncana/javascript/jquery.ui.core.min.js
extension/community_design/design/suncana/javascript/jquery.ui.widget.min.js
extension/community_design/design/suncana/javascript/jquery.easing.1.3.js
extension/community_design/design/suncana/javascript/jquery.ui.tabs.js
extension/community_design/design/suncana/javascript/jquery.hoverIntent.min.js
extension/community_design/design/suncana/javascript/jquery.popmenu.js
extension/community_design/design/suncana/javascript/jScrollPane.js
extension/community_design/design/suncana/javascript/jquery.mousewheel.js
extension/community_design/design/suncana/javascript/jquery.cycle.all.js
extension/sevenx/design/simple/javascript/jquery.scrollTo.js
extension/community_design/design/suncana/javascript/jquery.cookie.js
extension/community_design/design/suncana/javascript/ezstarrating_jquery.js
extension/community_design/design/suncana/javascript/jquery.initboxes.js
extension/community_design/design/suncana/javascript/app.js
extension/community_design/design/suncana/javascript/twitterwidget.js
extension/community_design/design/suncana/javascript/community.js
extension/community_design/design/suncana/javascript/roadmap.js
extension/community_design/design/suncana/javascript/ez.js
extension/community_design/design/suncana/javascript/ezshareevents.js
extension/sevenx/design/simple/javascript/main.js

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
1pagelayout.tpl<No override>extension/sevenx/design/simple/templates/pagelayout.tplEdit templateOverride template
 Number of times templates used: 12
 Number of unique templates used: 6

Time used to render debug report: 0.0003 secs