{"action":"created","issue":{"url":"https://api.github.com/repos/josegonzalez/cakephp-upload/issues/257","labels_url":"https://api.github.com/repos/josegonzalez/cakephp-upload/issues/257/labels{/name}","comments_url":"https://api.github.com/repos/josegonzalez/cakephp-upload/issues/257/comments","events_url":"https://api.github.com/repos/josegonzalez/cakephp-upload/issues/257/events","html_url":"https://github.com/josegonzalez/cakephp-upload/issues/257","id":47065027,"number":257,"title":"isFileUpload(...) validation failing.","user":{"login":"antoniovassell","id":4112695,"avatar_url":"https://avatars.githubusercontent.com/u/4112695?v=3","gravatar_id":"","url":"https://api.github.com/users/antoniovassell","html_url":"https://github.com/antoniovassell","followers_url":"https://api.github.com/users/antoniovassell/followers","following_url":"https://api.github.com/users/antoniovassell/following{/other_user}","gists_url":"https://api.github.com/users/antoniovassell/gists{/gist_id}","starred_url":"https://api.github.com/users/antoniovassell/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/antoniovassell/subscriptions","organizations_url":"https://api.github.com/users/antoniovassell/orgs","repos_url":"https://api.github.com/users/antoniovassell/repos","events_url":"https://api.github.com/users/antoniovassell/events{/privacy}","received_events_url":"https://api.github.com/users/antoniovassell/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/josegonzalez/cakephp-upload/labels/bug","name":"bug","color":"e10c02"},{"url":"https://api.github.com/repos/josegonzalez/cakephp-upload/labels/next","name":"next","color":"000000"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":5,"created_at":"2014-10-28T18:42:44Z","updated_at":"2015-02-18T08:40:08Z","closed_at":null,"body":"Having an issue with isFileUpload(...)\r\n\r\nhttps://github.com/josegonzalez/cakephp-upload/blob/master/Model/Behavior/UploadBehavior.php#L529\r\n\r\nThat specific line is comparing the value for the error code in the `$check` array with `UPLOAD_ERR_INI_SIZE`. \r\n\r\nHowever, if error code is '4' (character), it doesn't equal to the value `UPLOAD_ERR_NO_FILE` as that is 4 (int) because the condition is using `!==` operator. Suggest to change it to `!=`\r\n\r\nHow I attached the validation:\r\n\r\n```\r\n'attachment' => array(\r\n\t\t\tarray(\r\n\t\t\t\t'rule' => 'isFileUpload',\r\n\t\t\t\t'message' => 'Please select a file',\r\n\t\t\t),\r\n...\r\n```\r\n\r\nAnyone else having this issue?\r\nCakePHP Upload v 1.1.1,\r\nCakePHP 2.5.x\r\nPHP 5.5\r\nWindows 8.1"},"comment":{"url":"https://api.github.com/repos/josegonzalez/cakephp-upload/issues/comments/74830006","html_url":"https://github.com/josegonzalez/cakephp-upload/issues/257#issuecomment-74830006","issue_url":"https://api.github.com/repos/josegonzalez/cakephp-upload/issues/257","id":74830006,"user":{"login":"davidyell","id":49889,"avatar_url":"https://avatars.githubusercontent.com/u/49889?v=3","gravatar_id":"","url":"https://api.github.com/users/davidyell","html_url":"https://github.com/davidyell","followers_url":"https://api.github.com/users/davidyell/followers","following_url":"https://api.github.com/users/davidyell/following{/other_user}","gists_url":"https://api.github.com/users/davidyell/gists{/gist_id}","starred_url":"https://api.github.com/users/davidyell/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/davidyell/subscriptions","organizations_url":"https://api.github.com/users/davidyell/orgs","repos_url":"https://api.github.com/users/davidyell/repos","events_url":"https://api.github.com/users/davidyell/events{/privacy}","received_events_url":"https://api.github.com/users/davidyell/received_events","type":"User","site_admin":false},"created_at":"2015-02-18T08:40:08Z","updated_at":"2015-02-18T08:40:08Z","body":"I would be in favour of casting here and keeping the explicit comparison."}}