ZF2-336: Form files and enctype


I think that when someone declare:

{Code} $this->add($factory->createElement(array( 'name' => 'resource_image_file', 'attributes' => array( 'label' => 'File:', 'type' => 'file', ), ))); {Code}



form> element should add automatically the enctype="multipart/form-data" which is needed for successfully upload

Currently I need to do that explicitly using:

$add_resource_form->setAttribute('enctype', 'multipart/form-data');

From W3C {quote} enctype = content-type [CI] This attribute specifies the content type used to submit the form to the server (when the value of method is "post"). The default value for this attribute is "application/x-www-form-urlencoded". The value "multipart/form-data" should be used in combination with the INPUT element, type="file". {quote}


This issue has been closed on Jira and moved to GitHub for issue tracking. To continue following the resolution of this issues, please visit: https://github.com/zendframework/zf2/issues/2489