{"action":"created","issue":{"url":"https://api.github.com/repos/Azure/azure-storage-node/issues/470","repository_url":"https://api.github.com/repos/Azure/azure-storage-node","labels_url":"https://api.github.com/repos/Azure/azure-storage-node/issues/470/labels{/name}","comments_url":"https://api.github.com/repos/Azure/azure-storage-node/issues/470/comments","events_url":"https://api.github.com/repos/Azure/azure-storage-node/issues/470/events","html_url":"https://github.com/Azure/azure-storage-node/issues/470","id":334219450,"node_id":"MDU6SXNzdWUzMzQyMTk0NTA=","number":470,"title":"Can't write contentType using createBlockBlobFromStream","user":{"login":"graham-sportsmgmt","id":16939733,"node_id":"MDQ6VXNlcjE2OTM5NzMz","avatar_url":"https://avatars0.githubusercontent.com/u/16939733?v=4","gravatar_id":"","url":"https://api.github.com/users/graham-sportsmgmt","html_url":"https://github.com/graham-sportsmgmt","followers_url":"https://api.github.com/users/graham-sportsmgmt/followers","following_url":"https://api.github.com/users/graham-sportsmgmt/following{/other_user}","gists_url":"https://api.github.com/users/graham-sportsmgmt/gists{/gist_id}","starred_url":"https://api.github.com/users/graham-sportsmgmt/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/graham-sportsmgmt/subscriptions","organizations_url":"https://api.github.com/users/graham-sportsmgmt/orgs","repos_url":"https://api.github.com/users/graham-sportsmgmt/repos","events_url":"https://api.github.com/users/graham-sportsmgmt/events{/privacy}","received_events_url":"https://api.github.com/users/graham-sportsmgmt/received_events","type":"User","site_admin":false},"labels":[{"id":97877936,"node_id":"MDU6TGFiZWw5Nzg3NzkzNg==","url":"https://api.github.com/repos/Azure/azure-storage-node/labels/question","name":"question","color":"cc317c","default":true}],"state":"open","locked":false,"assignee":{"login":"XiaoningLiu","id":6889160,"node_id":"MDQ6VXNlcjY4ODkxNjA=","avatar_url":"https://avatars2.githubusercontent.com/u/6889160?v=4","gravatar_id":"","url":"https://api.github.com/users/XiaoningLiu","html_url":"https://github.com/XiaoningLiu","followers_url":"https://api.github.com/users/XiaoningLiu/followers","following_url":"https://api.github.com/users/XiaoningLiu/following{/other_user}","gists_url":"https://api.github.com/users/XiaoningLiu/gists{/gist_id}","starred_url":"https://api.github.com/users/XiaoningLiu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/XiaoningLiu/subscriptions","organizations_url":"https://api.github.com/users/XiaoningLiu/orgs","repos_url":"https://api.github.com/users/XiaoningLiu/repos","events_url":"https://api.github.com/users/XiaoningLiu/events{/privacy}","received_events_url":"https://api.github.com/users/XiaoningLiu/received_events","type":"User","site_admin":false},"assignees":[{"login":"XiaoningLiu","id":6889160,"node_id":"MDQ6VXNlcjY4ODkxNjA=","avatar_url":"https://avatars2.githubusercontent.com/u/6889160?v=4","gravatar_id":"","url":"https://api.github.com/users/XiaoningLiu","html_url":"https://github.com/XiaoningLiu","followers_url":"https://api.github.com/users/XiaoningLiu/followers","following_url":"https://api.github.com/users/XiaoningLiu/following{/other_user}","gists_url":"https://api.github.com/users/XiaoningLiu/gists{/gist_id}","starred_url":"https://api.github.com/users/XiaoningLiu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/XiaoningLiu/subscriptions","organizations_url":"https://api.github.com/users/XiaoningLiu/orgs","repos_url":"https://api.github.com/users/XiaoningLiu/repos","events_url":"https://api.github.com/users/XiaoningLiu/events{/privacy}","received_events_url":"https://api.github.com/users/XiaoningLiu/received_events","type":"User","site_admin":false}],"milestone":null,"comments":1,"created_at":"2018-06-20T19:34:43Z","updated_at":"2018-06-22T20:28:42Z","closed_at":null,"author_association":"NONE","body":"My package.json has `\"azure-storage\": \"^2.8.2\"` which results in my current version being `2.9.0-preview`.\r\n\r\nI am successfully writing a block blob using `createBlockBlobFromStream` but it's not accepting the contenttype parameter I am sending in.  The file name matches a document GUID from cosmosdb/documentdb.\r\n\r\nThis is the code I'm using to create the blob.  The metadata I'm passing in with the options is being stored successfully (see below).\r\n\r\n```\r\nmodule.exports.writeFileWithStream = function(fileSpec, stream, callback){\r\n\r\n  let form = new multiparty.Form();\r\n\r\n  form.on('part', function(part) {\r\n    if (!part.filename) return;\r\n\r\n    let size = part.byteCount;\r\n\r\n    blobService.createBlockBlobFromStream(fileSpec.container, fileSpec.file, part, size, fileSpec.options, function(error) {\r\n\r\n      if (error) {\r\n        console.error(`ERROR in storage.writeFileWithStream\\nFile Spec was: ${JSON.stringify(fileSpec)}\\nError:\\n${err}`);\r\n        callback(error);\r\n      }\r\n\r\n      callback(null, 'File uploaded successfully');\r\n\r\n    });\r\n  });\r\n\r\n  form.parse(stream);\r\n\r\n}\r\n```\r\n\r\nHere is my fileSpec object from console.log:\r\n\r\n```\r\n{\r\n   \"container\":\"forms\",\r\n   \"file\": \"75e146dc-cf30-d749-d0b4-b34ffb24628f\",\r\n   \"options\": {\r\n     \"contentSettings\": {\r\n       \"contenttype\": \"image/jpeg\"\r\n     },\r\n     \"metadata\": {\r\n       \"contenttype\":\"image/jpeg\"\r\n     }\r\n   }\r\n}\r\n```\r\n\r\nThe file is being written correctly, but this is the result from `blobService.getBlobProperties(fileSpec.container, fileSpec.file` - the contentType has not changed from the default :\r\n\r\n```\r\n{\r\n  container: 'forms',\r\n  name: '75e146dc-cf30-d749-d0b4-b34ffb24628f',\r\n  metadata: { contenttype: 'image/jpeg' },\r\n  lastModified: 'Wed, 20 Jun 2018 16:36:23 GMT',\r\n  etag: '\"0x8D5D6CBF61C84E2\"',\r\n  blobType: 'BlockBlob',\r\n  contentLength: '551900',\r\n  serverEncrypted: 'true',\r\n  requestId: 'c19f7481-501e-006a-7bbd-086cdd000000',\r\n  contentSettings:\r\n   { contentType: 'application/octet-stream',\r\n     contentMD5: 'oJrfbG/5d7E8gMWB8pjWjA==' },\r\n  lease: { status: 'unlocked', state: 'available' } \r\n}\r\n```"},"comment":{"url":"https://api.github.com/repos/Azure/azure-storage-node/issues/comments/399572511","html_url":"https://github.com/Azure/azure-storage-node/issues/470#issuecomment-399572511","issue_url":"https://api.github.com/repos/Azure/azure-storage-node/issues/470","id":399572511,"node_id":"MDEyOklzc3VlQ29tbWVudDM5OTU3MjUxMQ==","user":{"login":"graham-sportsmgmt","id":16939733,"node_id":"MDQ6VXNlcjE2OTM5NzMz","avatar_url":"https://avatars0.githubusercontent.com/u/16939733?v=4","gravatar_id":"","url":"https://api.github.com/users/graham-sportsmgmt","html_url":"https://github.com/graham-sportsmgmt","followers_url":"https://api.github.com/users/graham-sportsmgmt/followers","following_url":"https://api.github.com/users/graham-sportsmgmt/following{/other_user}","gists_url":"https://api.github.com/users/graham-sportsmgmt/gists{/gist_id}","starred_url":"https://api.github.com/users/graham-sportsmgmt/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/graham-sportsmgmt/subscriptions","organizations_url":"https://api.github.com/users/graham-sportsmgmt/orgs","repos_url":"https://api.github.com/users/graham-sportsmgmt/repos","events_url":"https://api.github.com/users/graham-sportsmgmt/events{/privacy}","received_events_url":"https://api.github.com/users/graham-sportsmgmt/received_events","type":"User","site_admin":false},"created_at":"2018-06-22T20:28:42Z","updated_at":"2018-06-22T20:28:42Z","author_association":"NONE","body":"Thanks, this does fix it.  \r\n\r\nI am sending this parameter through the http headers which automatically lowercases all keys, would it be possible to make this a case-insensitive property in a future release?"}}
{"actor":{"display_login":"graham-sportsmgmt"}}