{"action":"created","issue":{"url":"https://api.github.com/repos/rtomac/robotframework-selenium2library/issues/378","labels_url":"https://api.github.com/repos/rtomac/robotframework-selenium2library/issues/378/labels{/name}","comments_url":"https://api.github.com/repos/rtomac/robotframework-selenium2library/issues/378/comments","events_url":"https://api.github.com/repos/rtomac/robotframework-selenium2library/issues/378/events","html_url":"https://github.com/rtomac/robotframework-selenium2library/issues/378","id":69535082,"number":378,"title":"Choose file sends file as application/octet-stream, but needs text/csv","user":{"login":"chevi","id":1729590,"avatar_url":"https://avatars.githubusercontent.com/u/1729590?v=3","gravatar_id":"","url":"https://api.github.com/users/chevi","html_url":"https://github.com/chevi","followers_url":"https://api.github.com/users/chevi/followers","following_url":"https://api.github.com/users/chevi/following{/other_user}","gists_url":"https://api.github.com/users/chevi/gists{/gist_id}","starred_url":"https://api.github.com/users/chevi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/chevi/subscriptions","organizations_url":"https://api.github.com/users/chevi/orgs","repos_url":"https://api.github.com/users/chevi/repos","events_url":"https://api.github.com/users/chevi/events{/privacy}","received_events_url":"https://api.github.com/users/chevi/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":{"login":"zephraph","id":3087225,"avatar_url":"https://avatars.githubusercontent.com/u/3087225?v=3","gravatar_id":"","url":"https://api.github.com/users/zephraph","html_url":"https://github.com/zephraph","followers_url":"https://api.github.com/users/zephraph/followers","following_url":"https://api.github.com/users/zephraph/following{/other_user}","gists_url":"https://api.github.com/users/zephraph/gists{/gist_id}","starred_url":"https://api.github.com/users/zephraph/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zephraph/subscriptions","organizations_url":"https://api.github.com/users/zephraph/orgs","repos_url":"https://api.github.com/users/zephraph/repos","events_url":"https://api.github.com/users/zephraph/events{/privacy}","received_events_url":"https://api.github.com/users/zephraph/received_events","type":"User","site_admin":false},"milestone":null,"comments":2,"created_at":"2015-04-20T08:25:31Z","updated_at":"2015-04-28T17:23:06Z","closed_at":null,"body":"Hi,\r\n\r\nI want to test functionality where user uploads csv file. And on server there is verification of the uploaded file type:\r\n```\r\nfile_content_type != 'text/csv' && file_content_type != 'application/vnd.ms-excel'\r\n```\r\n\r\nWhen I make \"Choose file\" with Selenium2Library and submit, I get error from server that file type is incorrect. Basically it was sent as **application/octet-stream** type, but when I do the same manually, browser sends **text/csv** type.\r\n\r\nIs it possible to add additional parameter to the keyword \"Choose file\", where will be possible to specify file type?\r\nExample:\r\n\r\nKeyword | locator | path | file type\r\n------------ | ------------- | ------------- | -------------\r\nChoose file|        file  |   test.csv   |   text/csv\r\n"},"comment":{"url":"https://api.github.com/repos/rtomac/robotframework-selenium2library/issues/comments/97142872","html_url":"https://github.com/rtomac/robotframework-selenium2library/issues/378#issuecomment-97142872","issue_url":"https://api.github.com/repos/rtomac/robotframework-selenium2library/issues/378","id":97142872,"user":{"login":"zephraph","id":3087225,"avatar_url":"https://avatars.githubusercontent.com/u/3087225?v=3","gravatar_id":"","url":"https://api.github.com/users/zephraph","html_url":"https://github.com/zephraph","followers_url":"https://api.github.com/users/zephraph/followers","following_url":"https://api.github.com/users/zephraph/following{/other_user}","gists_url":"https://api.github.com/users/zephraph/gists{/gist_id}","starred_url":"https://api.github.com/users/zephraph/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zephraph/subscriptions","organizations_url":"https://api.github.com/users/zephraph/orgs","repos_url":"https://api.github.com/users/zephraph/repos","events_url":"https://api.github.com/users/zephraph/events{/privacy}","received_events_url":"https://api.github.com/users/zephraph/received_events","type":"User","site_admin":false},"created_at":"2015-04-28T17:23:06Z","updated_at":"2015-04-28T17:23:06Z","body":"Okay, so I haven't messed with form uploads in a while and I was reading up on this.\r\n\r\nI assume when you did this manually you pulled up the file browser dialog and selected the file that way. When the RF-S2L selects a file it simply types the file name into the upload dialog box. My hypothesis is that your browser then doesn't specify what the mime type for whatever reason and just falls back to *application/octet-stream*. The bad news here is, there's no way (that I have found) to set the mime type. \r\n\r\nSo technically as per your suggestion this doesn't seem to be possible. There may be a work around to fix your particular issue, but that'll require some more investigation. What browser are you testing this against?"}}