Problem with input type = "file" not working

Author Message

meriam santos

Sunday 21 February 2010 2:23:26 pm

Hi there,Have this problem and no idea why its not uploading the file. I have added a new attribute - file, to an existing class. added this code:Can somebody please help me?cheers...

meriam santos

Sunday 21 February 2010 2:24:35 pm

"<input type="file" name="attr_{$ContentObjectAttribute:item.contentclass_attribute_identifier} value="{$ContentObjectAttribute:item.content}" />"

André R.

Monday 22 February 2010 7:06:10 am

Looks like name is incorrect.

Take a look in the normal template for the datatype you added in design/standard/templates/content/datatype/edit/ezbinary.tpl

In trunk it has name like this:

name="{$attribute_base}_data_binaryfilename_{$attribute.id}"

And it does not use content as the value of the input.

eZ Online Editor 5: http://projects.ez.no/ezoe || eZJSCore (Ajax): http://projects.ez.no/ezjscore || eZ Publish EE http://ez.no/eZPublish/eZ-Publish-Enterprise-Subscription
@: http://twitter.com/andrerom

meriam santos

Monday 22 February 2010 5:50:13 pm

Hi Andre,

Thank you for your reply. I tried changing the code but still not uploading or changing if the file exist.to give you an idea here is the rest of the code:

the code used for the text area. this one displays the text and can be edited.

" {* Sequence number override *}
{if eq($ContentObjectAttribute:item.contentclass_attribute.name|wash, "Sequence Numbers")}
<input type="hidden" name="EditContentObject" value="true" /> <p class="box">
<textarea {if not($content_object.can_edit)}READONLY{/if}
name="attr_{$ContentObjectAttribute:item.contentclass_attribute_identifier}" cols="52"
rows="{$ContentObjectAttribute:item.contentclass_attribute.data_int1}">{$ContentObjectAttribute:item.content}</textarea></p> "

code i used for file type. this code displays the current file if any and a browse button for upload but its not making any changes to the file attribute.

"{elseif eq($ContentObjectAttribute:item.contentclass_attribute.name|wash, "Tracking sheet")}
{section show=$content_object.can_edit}
{attribute_edit_gui attribute_base=$attribute_base attribute=$ContentObjectAttribute:item}
{section-else}
{attribute_view_gui attribute_base=$attribute_base attribute=$ContentObjectAttribute:item}
{/section} "

can you please tell me what i'm missing? its simple for textarea.

Really appreciate any reply from you.

cheers

meriam santos

Monday 22 February 2010 6:18:23 pm

By the way the code is inside a form: the form edits the status of the record from one location to Archive. I dont know how to pass the changes to the file attribute.

"<form method="post" onsubmit="return confirmSubmit()" name='recoveryForm' action={"content/action"|ezurl}> <input type="hidden" name="EditContentObject" value="true" />
<input type="hidden" name='attr_status' value="0"/>
<input name="MoveButton" type="submit" value="Archive"/>
<input type="hidden" name='MoveToParentNode' value="{$archive_node}"/>"

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

Main resources:

Total runtime0.7105 sec
Peak memory usage4,096.0000 KB
Database Queries63

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0056 588.0469152.6406
Module start 'layout' 0.00560.0040 740.687539.4766
Module start 'content' 0.00960.6997 780.1641562.7734
Module end 'content' 0.70920.0013 1,342.937512.1250
Script end 0.7105  1,355.0625 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00330.4610160.0002
Check MTime0.00140.1944160.0001
Mysql Total
Database connection0.00070.101510.0007
Mysqli_queries0.651991.7528630.0103
Looping result0.00070.0987610.0000
Template Total0.675695.120.3378
Template load0.00200.275720.0010
Template processing0.673694.805920.3368
Template load and register function0.00020.031810.0002
states
state_id_array0.00160.228710.0016
state_identifier_array0.00140.192120.0007
Override
Cache load0.00170.2362390.0000
Sytem overhead
Fetch class attribute can translate value0.00080.119420.0004
Fetch class attribute name0.00150.207560.0002
XML
Image XML parsing0.00060.089020.0003
class_abstraction
Instantiating content class attribute0.00000.002360.0000
General
dbfile0.00090.1211170.0001
String conversion0.00000.001240.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
5content/datatype/view/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
8content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
1content/datatype/view/ezimage.tpl<No override>extension/sevenx/design/simple/templates/content/datatype/view/ezimage.tplEdit templateOverride template
3content/datatype/view/ezxmltags/line.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/line.tplEdit templateOverride template
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_pagelayout.tplEdit templateOverride template
 Number of times templates used: 19
 Number of unique templates used: 6

Time used to render debug report: 0.0001 secs