{"action":"created","issue":{"url":"https://api.github.com/repos/zendframework/zf2/issues/7096","labels_url":"https://api.github.com/repos/zendframework/zf2/issues/7096/labels{/name}","comments_url":"https://api.github.com/repos/zendframework/zf2/issues/7096/comments","events_url":"https://api.github.com/repos/zendframework/zf2/issues/7096/events","html_url":"https://github.com/zendframework/zf2/issues/7096","id":53316231,"number":7096,"title":"Zend\\Form\\Element\\File doesnt work with Annotations and Doctrine","user":{"login":"cbichis","id":6471173,"avatar_url":"https://avatars.githubusercontent.com/u/6471173?v=3","gravatar_id":"","url":"https://api.github.com/users/cbichis","html_url":"https://github.com/cbichis","followers_url":"https://api.github.com/users/cbichis/followers","following_url":"https://api.github.com/users/cbichis/following{/other_user}","gists_url":"https://api.github.com/users/cbichis/gists{/gist_id}","starred_url":"https://api.github.com/users/cbichis/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cbichis/subscriptions","organizations_url":"https://api.github.com/users/cbichis/orgs","repos_url":"https://api.github.com/users/cbichis/repos","events_url":"https://api.github.com/users/cbichis/events{/privacy}","received_events_url":"https://api.github.com/users/cbichis/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/zendframework/zf2/labels/bug","name":"bug","color":"fc2929"},{"url":"https://api.github.com/repos/zendframework/zf2/labels/Form","name":"Form","color":"008000"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":4,"created_at":"2015-01-03T21:40:08Z","updated_at":"2015-01-04T12:11:42Z","closed_at":null,"body":"Hello,\r\n\r\nIt seems Zend\\Form\\Element\\File doesn't work if we use along both with Annotations and Doctrine:\r\n\r\n```\r\n    /** \r\n     * @var string\r\n     * @ORM\\Column(type=\"string\", length=256, nullable=false)\r\n     * @Annotation\\Type(\"Zend\\Form\\Element\\File\")\r\n     * @Annotation\\Options({\"label\":\"Image\"})\r\n     */\r\n    protected $image;\r\n```\r\nis rendered as:\r\n```\r\n<label><span>Image</span><input name=\"image\" type=\"text\" value=\"\"></label>\r\n```\r\n\r\nIf we remove the ORM part then form file element is rendered correctly:\r\n```\r\n<label><span>Image</span><input type=\"file\" name=\"image\"></label>\r\n```\r\n\r\nNote:\r\n\r\nI do have set this methods within entity:\r\n```\r\n    public function getImage() {\r\n        return $this->image;\r\n    }\r\n\r\n    public function setImage($image) {\r\n        if (is_array($image) && isset($image['tmp_name'])) {\r\n            $image = $image['tmp_name'];\r\n        }\r\n\r\n        $this->image = $image;\r\n    public function getImage() {\r\n        return $this->image;\r\n    }\r\n\r\n    public function setImage($image) {\r\n        if (is_array($image) && isset($image['tmp_name'])) {\r\n            $image = $image['tmp_name'];\r\n        }\r\n\r\n        $this->image = $image;\r\n\r\n        return $this;\r\n    }\r\n        return $this;\r\n    }\r\n```"},"comment":{"url":"https://api.github.com/repos/zendframework/zf2/issues/comments/68630749","html_url":"https://github.com/zendframework/zf2/issues/7096#issuecomment-68630749","issue_url":"https://api.github.com/repos/zendframework/zf2/issues/7096","id":68630749,"user":{"login":"cbichis","id":6471173,"avatar_url":"https://avatars.githubusercontent.com/u/6471173?v=3","gravatar_id":"","url":"https://api.github.com/users/cbichis","html_url":"https://github.com/cbichis","followers_url":"https://api.github.com/users/cbichis/followers","following_url":"https://api.github.com/users/cbichis/following{/other_user}","gists_url":"https://api.github.com/users/cbichis/gists{/gist_id}","starred_url":"https://api.github.com/users/cbichis/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cbichis/subscriptions","organizations_url":"https://api.github.com/users/cbichis/orgs","repos_url":"https://api.github.com/users/cbichis/repos","events_url":"https://api.github.com/users/cbichis/events{/privacy}","received_events_url":"https://api.github.com/users/cbichis/received_events","type":"User","site_admin":false},"created_at":"2015-01-04T12:11:42Z","updated_at":"2015-01-04T12:11:42Z","body":"It seems the StringLength validator is added to the InputFilter of the element. This one is triggering the error."}}