{"action":"created","issue":{"url":"https://api.github.com/repos/eligrey/FileSaver.js/issues/270","repository_url":"https://api.github.com/repos/eligrey/FileSaver.js","labels_url":"https://api.github.com/repos/eligrey/FileSaver.js/issues/270/labels{/name}","comments_url":"https://api.github.com/repos/eligrey/FileSaver.js/issues/270/comments","events_url":"https://api.github.com/repos/eligrey/FileSaver.js/issues/270/events","html_url":"https://github.com/eligrey/FileSaver.js/issues/270","id":181359866,"number":270,"title":"File saver not working for ppt documents..","user":{"login":"jithuakumar","id":22656259,"avatar_url":"https://avatars.githubusercontent.com/u/22656259?v=3","gravatar_id":"","url":"https://api.github.com/users/jithuakumar","html_url":"https://github.com/jithuakumar","followers_url":"https://api.github.com/users/jithuakumar/followers","following_url":"https://api.github.com/users/jithuakumar/following{/other_user}","gists_url":"https://api.github.com/users/jithuakumar/gists{/gist_id}","starred_url":"https://api.github.com/users/jithuakumar/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jithuakumar/subscriptions","organizations_url":"https://api.github.com/users/jithuakumar/orgs","repos_url":"https://api.github.com/users/jithuakumar/repos","events_url":"https://api.github.com/users/jithuakumar/events{/privacy}","received_events_url":"https://api.github.com/users/jithuakumar/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/eligrey/FileSaver.js/labels/Make%20a%20Blob","name":"Make a Blob","color":"006b75"}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":2,"created_at":"2016-10-06T09:03:06Z","updated_at":"2016-10-06T09:29:36Z","closed_at":null,"body":"I am sending my ppt from wcf service as stream file... (i can send it as a byte[] as well if required) ,.. but not able to download it in the client side\r\n\r\n```javascript\r\nstring filepath = \"C:\\\\BKUP2\\\\Files\\\\xample.pptx\";\r\nString[] filename=filepath.Split('\\\\');            \r\nWebOperationContext.Current.OutgoingResponse.ContentType = \"application/octet-stream\";\r\n// WebOperationContext.Current.OutgoingResponse.ContentType = \"application/x-mspowerpoint\";\r\nif(File.Exists(filepath))\r\n{\r\n   String headerInfo = \"attachment; filename=\" + filename[filename.Length - 1];\r\n   WebOperationContext.Current.OutgoingResponse.Headers[\"Content-Disposition\"] = headerInfo;\r\n   return File.OpenRead(filepath);\r\n}\r\nelse\r\n{\r\n   String headerInfo = \"attachment; filename=\" + \"error.txt\";\r\n   WebOperationContext.Current.OutgoingResponse.Headers[\"Content-Disposition\"] = headerInfo;\r\n   string errortext=\"file not found\";\r\n   byte[] byteArray = Encoding.ASCII.GetBytes(errortext);\r\n   MemoryStream stream = new MemoryStream(byteArray);\r\n   return stream;\r\n}\r\n```\r\n\r\nin client side\r\n\r\n```javascript\r\nfunction ServiceSucceeded2(data) {          \r\n    var byteArray = (data);\r\n    var blob = new Blob([byteArray], { type: \"application/octet-stream\" });\r\n    var fileName = \"ABA_examplereportoutppt.pptx\";\r\n    saveAs(blob, fileName);\r\n} \r\n```\r\n\r\nplease help me.. if file saver cant do.. do we have any alternate option? i cannot force download from server with response object as it is wcf"},"comment":{"url":"https://api.github.com/repos/eligrey/FileSaver.js/issues/comments/251912143","html_url":"https://github.com/eligrey/FileSaver.js/issues/270#issuecomment-251912143","issue_url":"https://api.github.com/repos/eligrey/FileSaver.js/issues/270","id":251912143,"user":{"login":"jithuakumar","id":22656259,"avatar_url":"https://avatars.githubusercontent.com/u/22656259?v=3","gravatar_id":"","url":"https://api.github.com/users/jithuakumar","html_url":"https://github.com/jithuakumar","followers_url":"https://api.github.com/users/jithuakumar/followers","following_url":"https://api.github.com/users/jithuakumar/following{/other_user}","gists_url":"https://api.github.com/users/jithuakumar/gists{/gist_id}","starred_url":"https://api.github.com/users/jithuakumar/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jithuakumar/subscriptions","organizations_url":"https://api.github.com/users/jithuakumar/orgs","repos_url":"https://api.github.com/users/jithuakumar/repos","events_url":"https://api.github.com/users/jithuakumar/events{/privacy}","received_events_url":"https://api.github.com/users/jithuakumar/received_events","type":"User","site_admin":false},"created_at":"2016-10-06T09:29:36Z","updated_at":"2016-10-06T09:29:36Z","body":"Hi Jimmy, thank you for the update.\r\n\r\nthis is my client side ajax code.    $.ajax({\r\n                type: \"POST\",\r\n                url: \"http://localhost:59793/PPTService.svc/GetPPTFromService\",\r\n                cache: false,\r\n               \r\n               \r\n                contentType: \"application/json; charset=utf-8\",\r\n                  success: ServiceSucceeded2\r\n            });\r\n\r\nthere is no download option appearing even after sending the content headers... Do i miss something in the client side to get it downloaded? window.location is not working either. Appreciated if you can help on this. \r\n\r\nRegards,\r\nJithu. You can close this post if Filesaver is not an option for this."}}
{"actor":{"display_login":"jithuakumar"}}