Issues

ZF2-336: Form files and enctype

Issue Type: Improvement Created: 2012-06-01T15:20:01.000+0000 Last Updated: 2012-10-08T20:16:36.000+0000 Status: Closed Fix version(s): Reporter: Michael Ben-Nes (mbn_18) Assignee: Matthew Weier O'Phinney (matthew) Tags: - Zend\Form

  • form
  • w3c

Related issues: Attachments:

Description

I think that when someone declare:

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

The

<

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

Currently I need to do that explicitly using:

<pre class="highlight">
$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}

Comments

Posted by Robert Boloc (robertboloc) on 2012-09-07T10:33:50.000+0000

added in this pull request: https://github.com/zendframework/zf2/pull/2313

Posted by Ralph Schindler (ralph) on 2012-10-08T20:16:36.000+0000

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

Have you found an issue?

See the Overview section for more details.

Copyright

© 2006-2016 by Zend, a Rogue Wave Company. Made with by awesome contributors.

This website is built using zend-expressive and it runs on PHP 7.

Contacts