Trying to download file from server using angularJS and c# webapi

When uploading files to the server it goes great; no damaged files. However when i download files ( other than pure txt:s they woork)
they grow in size and become corrupt. After alot of investigation I dont know what could be wrong. Im simply writing the file
as a stream to the response and downloading the blob.
Any ideas are welcome!