{"action":"opened","issue":{"url":"https://api.github.com/repos/valor-software/ng2-file-upload/issues/532","repository_url":"https://api.github.com/repos/valor-software/ng2-file-upload","labels_url":"https://api.github.com/repos/valor-software/ng2-file-upload/issues/532/labels{/name}","comments_url":"https://api.github.com/repos/valor-software/ng2-file-upload/issues/532/comments","events_url":"https://api.github.com/repos/valor-software/ng2-file-upload/issues/532/events","html_url":"https://github.com/valor-software/ng2-file-upload/issues/532","id":195357432,"number":532,"title":"onBuildItemForm in filereader onLoad function","user":{"login":"vdevarapalli","id":23662363,"avatar_url":"https://avatars.githubusercontent.com/u/23662363?v=3","gravatar_id":"","url":"https://api.github.com/users/vdevarapalli","html_url":"https://github.com/vdevarapalli","followers_url":"https://api.github.com/users/vdevarapalli/followers","following_url":"https://api.github.com/users/vdevarapalli/following{/other_user}","gists_url":"https://api.github.com/users/vdevarapalli/gists{/gist_id}","starred_url":"https://api.github.com/users/vdevarapalli/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vdevarapalli/subscriptions","organizations_url":"https://api.github.com/users/vdevarapalli/orgs","repos_url":"https://api.github.com/users/vdevarapalli/repos","events_url":"https://api.github.com/users/vdevarapalli/events{/privacy}","received_events_url":"https://api.github.com/users/vdevarapalli/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2016-12-13T20:19:11Z","updated_at":"2016-12-13T20:19:11Z","closed_at":null,"body":"i am converting selected file to BinaryString using fileReader onload function.\r\n\r\ncan i call **this.uploader.onBuildItemForm** in fileReader onload function,.\r\n\r\n<input type=\"file\" ng2FileSelect [uploader]=\"uploader\" id=\"fileUpload\" (change) = \"handleFileSelect($event)\"/>\r\n\r\n  public uploader:FileUploader = new FileUploader({url:'http://localhost:8080/new', \r\n    autoUpload: true,\r\n    allowedMimeType: ['image/png', 'image/jpg', 'image/bmp', 'application/pdf'],\r\n    maxFileSize: 5*1024*1024 // 5 MB\r\n  });\r\n\r\n  handleFileUpload(selectedFile):void {\r\n  \t\tlet fileReader = new FileReader();\r\n  \t\tfileReader.onload = () => {\r\n        this.imageStream = btoa(fileReader.result);\r\n  \t\t}\r\n      fileReader.readAsBinaryString(selectedFile);\r\n      fileReader.onloadend = () => {\r\n          setTimeout(() => {\r\n            this.uploader.onBuildItemForm = (item, form) => {\r\n              console.log('..............' + this.imageStream);\r\n              form.append(\"blob\", this.imageStream);  \r\n            };\r\n          }, 5000);        \r\n        }        \r\n\t} \r\n\r\nPlease Help me.... i am stuck here"}}
{"actor":{"display_login":"vdevarapalli"}}