error while upload file ERR_INCOMPLETE_CHUNKED_ENCODING #948

Open
opened 2017-12-21 13:05:36 +00:00 by lakhank295 · 0 comments
lakhank295 commented 2017-12-21 13:05:36 +00:00 (Migrated from github.com)

hello i am sending file using formdata following is the code.
`var obj = {};
obj['Authorization'] = "f3d4509d89e6240cfa221a3a7bee46860e0129bc";
obj['Content-Type'] = "multipart/form-data;boundary=----amrut";
obj['Source'] = 'WEB';
obj['Accept'] = 'application/json';
this.uploader.setOptions(obj);
console.log(e.target.files[0]);
this.uploader.onBeforeUploadItem = (item) => {
item.withCredentials = false;
}
// this.uploader.authToken='5d29b29c6890cf1b7e8d48f885f498bf37a3f0a0';
// this.uploader.authTokenHeader

this.uploader.onBuildItemForm = (fileItem: any, form: any) => {
form.append('submoduleid', '9bfc2630c17144e59838153d7d70db66');
form.append("file", fileItem);
}`
while sending file formdata is empty & getting an error 'ERR_INCOMPLETE_CHUNKED_ENCODING' .
how can i solve this. i am attaching an image find the attachment
error

hello i am sending file using formdata following is the code. `var obj = {}; obj['Authorization'] = "f3d4509d89e6240cfa221a3a7bee46860e0129bc"; obj['Content-Type'] = "multipart/form-data;boundary=----amrut"; obj['Source'] = 'WEB'; obj['Accept'] = 'application/json'; this.uploader.setOptions(obj); console.log(e.target.files[0]); this.uploader.onBeforeUploadItem = (item) => { item.withCredentials = false; } // this.uploader.authToken='5d29b29c6890cf1b7e8d48f885f498bf37a3f0a0'; // this.uploader.authTokenHeader this.uploader.onBuildItemForm = (fileItem: any, form: any) => { form.append('submoduleid', '9bfc2630c17144e59838153d7d70db66'); form.append("file", fileItem); }` while sending file formdata is empty & getting an error 'ERR_INCOMPLETE_CHUNKED_ENCODING' . how can i solve this. i am attaching an image find the attachment ![error](https://user-images.githubusercontent.com/30143510/34256938-b7ea6078-e67d-11e7-9a8a-5692b086aa74.png)
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: dc/ng2-file-upload#948