{"action":"created","issue":{"url":"https://api.github.com/repos/aio-libs/aiohttp/issues/2570","repository_url":"https://api.github.com/repos/aio-libs/aiohttp","labels_url":"https://api.github.com/repos/aio-libs/aiohttp/issues/2570/labels{/name}","comments_url":"https://api.github.com/repos/aio-libs/aiohttp/issues/2570/comments","events_url":"https://api.github.com/repos/aio-libs/aiohttp/issues/2570/events","html_url":"https://github.com/aio-libs/aiohttp/issues/2570","id":277692573,"number":2570,"title":"Header is prepended to actual file when uploading via PUT","user":{"login":"hongquan","id":314607,"avatar_url":"https://avatars3.githubusercontent.com/u/314607?v=4","gravatar_id":"","url":"https://api.github.com/users/hongquan","html_url":"https://github.com/hongquan","followers_url":"https://api.github.com/users/hongquan/followers","following_url":"https://api.github.com/users/hongquan/following{/other_user}","gists_url":"https://api.github.com/users/hongquan/gists{/gist_id}","starred_url":"https://api.github.com/users/hongquan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hongquan/subscriptions","organizations_url":"https://api.github.com/users/hongquan/orgs","repos_url":"https://api.github.com/users/hongquan/repos","events_url":"https://api.github.com/users/hongquan/events{/privacy}","received_events_url":"https://api.github.com/users/hongquan/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":2,"created_at":"2017-11-29T09:58:48Z","updated_at":"2017-11-29T11:05:02Z","closed_at":null,"author_association":"NONE","body":"## Long story short\r\n\r\nI'm uploading file to [Yandex Disk](https://tech.yandex.com/disk/api/reference/upload-docpage/). Yandex API is abnormal because it requires to use PUT method to upload file.\r\n\r\n## Expected behaviour\r\n\r\nThe file after upload should be the same as the file on local disk.\r\n\r\n## Actual behaviour\r\n\r\nThe file is prepended 5 lines of content, which looks like HTTP header:\r\n\r\n```sh\r\n$ head -n 5 plantinghouse_20171129-163839.sql.gz   \r\n--736ed73419b14e18aaa25da51b721c7d\r\nContent-Disposition: form-data; name=\"file\"; filename=\"tmpr935f7qc\"; filename*=utf-8''tmpr935f7qc\r\nContent-Type: application/octet-stream\r\nContent-Length: 25070\r\n```\r\n\r\n## Steps to reproduce\r\n\r\nI write a script to export database from PostgreSQL, gzip it to a file in _/tmp_. The name `tmpr935f7qc` in the example above is the name of generated gzip file.\r\nThe script then uses `aiohttp` to upload file to Yandex Disk, through Yandex REST API.\r\n\r\n## Your environment\r\naiohttp client 2.3.3\r\nPython 3.6, ARMv7\r\nOS: Debian 9, for BeagleBone Black board.\r\nNo proxy\r\n\r\nTested file (after uploaded):\r\n[plantinghouse_20171129-163839.sql.gz](https://github.com/aio-libs/aiohttp/files/1513275/plantinghouse_20171129-163839.sql.gz)\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/aio-libs/aiohttp/issues/comments/347827103","html_url":"https://github.com/aio-libs/aiohttp/issues/2570#issuecomment-347827103","issue_url":"https://api.github.com/repos/aio-libs/aiohttp/issues/2570","id":347827103,"user":{"login":"kxepal","id":785983,"avatar_url":"https://avatars0.githubusercontent.com/u/785983?v=4","gravatar_id":"","url":"https://api.github.com/users/kxepal","html_url":"https://github.com/kxepal","followers_url":"https://api.github.com/users/kxepal/followers","following_url":"https://api.github.com/users/kxepal/following{/other_user}","gists_url":"https://api.github.com/users/kxepal/gists{/gist_id}","starred_url":"https://api.github.com/users/kxepal/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kxepal/subscriptions","organizations_url":"https://api.github.com/users/kxepal/orgs","repos_url":"https://api.github.com/users/kxepal/repos","events_url":"https://api.github.com/users/kxepal/events{/privacy}","received_events_url":"https://api.github.com/users/kxepal/received_events","type":"User","site_admin":false},"created_at":"2017-11-29T11:05:02Z","updated_at":"2017-11-29T11:05:02Z","author_association":"OWNER","body":"I would guess that you need to send file content as is, in binary form, not as multipart."}}
{"actor":{"display_login":"kxepal"}}