{"action":"created","issue":{"url":"https://api.github.com/repos/vsivsi/meteor-file-collection/issues/27","labels_url":"https://api.github.com/repos/vsivsi/meteor-file-collection/issues/27/labels{/name}","comments_url":"https://api.github.com/repos/vsivsi/meteor-file-collection/issues/27/comments","events_url":"https://api.github.com/repos/vsivsi/meteor-file-collection/issues/27/events","html_url":"https://github.com/vsivsi/meteor-file-collection/pull/27","id":53925039,"number":27,"title":"Added byte serving capability to http server (206 range request)","user":{"login":"riaan53","id":7716342,"avatar_url":"https://avatars.githubusercontent.com/u/7716342?v=3","gravatar_id":"","url":"https://api.github.com/users/riaan53","html_url":"https://github.com/riaan53","followers_url":"https://api.github.com/users/riaan53/followers","following_url":"https://api.github.com/users/riaan53/following{/other_user}","gists_url":"https://api.github.com/users/riaan53/gists{/gist_id}","starred_url":"https://api.github.com/users/riaan53/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/riaan53/subscriptions","organizations_url":"https://api.github.com/users/riaan53/orgs","repos_url":"https://api.github.com/users/riaan53/repos","events_url":"https://api.github.com/users/riaan53/events{/privacy}","received_events_url":"https://api.github.com/users/riaan53/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":30,"created_at":"2015-01-09T22:48:24Z","updated_at":"2015-03-03T04:01:21Z","closed_at":"2015-02-27T01:40:50Z","pull_request":{"url":"https://api.github.com/repos/vsivsi/meteor-file-collection/pulls/27","html_url":"https://github.com/vsivsi/meteor-file-collection/pull/27","diff_url":"https://github.com/vsivsi/meteor-file-collection/pull/27.diff","patch_url":"https://github.com/vsivsi/meteor-file-collection/pull/27.patch"},"body":"Hi!\r\n\r\nI thought this might be of use to others :)\r\n\r\nI added http 206 range request to the http get method. This will allow for audio/video streaming and use of the video/audio seek bar.\r\n\r\nI also added a new query parameter to be able to cache selected files in the browser, which is very useful for videos/images/audio. For example: '?cache=172800' will set 'cache-control:max-age=172800, private' in the header. This can be improved later on with more options and so on.\r\n\r\nThe '?download=false' query parameter will work now. A string compare was done as query params is return as string and not bool.\r\n\r\nNotes:\r\n- Im not used to coffee script so might have missed something :)\r\n- Im receiving 'Warning: gridfs-locking-stream received duplicate end/close events for file' while streaming a lot and doing a lot of range requests.\r\n- I modified your demo app and wanted to host it on amazon but I received 'js-bson: Failed to load c++ bson extension, using pure JS version'. The app starts but am not able to download a file successfully. I saw the ticket that you fixed and install c++ but it did not help. Ubuntu 14.04.1 LTS on amazon free tier.\r\n- You can find the modified sample app here: https://github.com/riaan53/meteor-file-sample-app . Will do a PR if you want but first want to make some improvements to the things I did - dynamic templates and clean-up. \r\n- I tested it in chrome, safari and iOS iphone5 cordova. All latest versions as of now.\r\n\r\nLet me know if you want me to make some changes if you want to accept the PR.\r\n\r\nRegards,\r\nRiaan"},"comment":{"url":"https://api.github.com/repos/vsivsi/meteor-file-collection/issues/comments/76883299","html_url":"https://github.com/vsivsi/meteor-file-collection/pull/27#issuecomment-76883299","issue_url":"https://api.github.com/repos/vsivsi/meteor-file-collection/issues/27","id":76883299,"user":{"login":"vsivsi","id":428642,"avatar_url":"https://avatars.githubusercontent.com/u/428642?v=3","gravatar_id":"","url":"https://api.github.com/users/vsivsi","html_url":"https://github.com/vsivsi","followers_url":"https://api.github.com/users/vsivsi/followers","following_url":"https://api.github.com/users/vsivsi/following{/other_user}","gists_url":"https://api.github.com/users/vsivsi/gists{/gist_id}","starred_url":"https://api.github.com/users/vsivsi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vsivsi/subscriptions","organizations_url":"https://api.github.com/users/vsivsi/orgs","repos_url":"https://api.github.com/users/vsivsi/repos","events_url":"https://api.github.com/users/vsivsi/events{/privacy}","received_events_url":"https://api.github.com/users/vsivsi/received_events","type":"User","site_admin":false},"created_at":"2015-03-03T04:01:21Z","updated_at":"2015-03-03T04:01:21Z","body":"@riaan53   I'm still working on fixing some bugs revealed by my testing.  The worst one is a bug that causes resumable uploads creating more than 1000 chunks to fail.  It stems from a change in behavior in the mongodb 2.0.x node driver that by default limits the number of results from a `cursor.toArray()` call to 1000 documents.\r\n\r\nUnfortunately, in trying to fix/work around this issue, I have uncovered an even more critical bug in the 2.0.x driver that I have reported here: https://jira.mongodb.org/browse/NODE-379\r\nAnd fixed here: https://github.com/mongodb/node-mongodb-native/pull/1262\r\n\r\nNot sure how long it will take for @christkv to turn this around on npm, but I obviously can't publish the new version of this package until this bug is fixed, since all gridFS collections have dots in their names."}}