0
votes

Currently inside my angular2 project I use ng2fileupload to upload some files to azure blob storage.

For some reason the uploaded file is corrupt when received server side. The reason the file i corrupt is because the file content is wrapped inside text:

-----------------webKitBoundary7e133e31c05a0
Content-Disposition: form-data; name="file"; filename="service_catalog3.png" Content-Type: image/png

‰PNG (actual png content)
....
-----------------------------7e133e31c05a0--

How do I prevent that my file content is being wrapped iside this weird webKitBoundary7e133e31c05a0 string?

Any help on this ?

1

1 Answers

0
votes

Ok. Found it. Cost me several hours :-(

You need to set disableMultipart to TRUE

var uo: FileUploaderOptions = {};
uo.disableMultipart = true;

this.uploader.setOptions(uo);

Hope this helps someone !!