WCF is most likely encoding the returned data as either XML or JSON. You need to tell it to return the raw binary data.
For example:
Public Function GetFilePart(ByVal currentPartNumber As Integer) As Stream
OutgoingResponse.ContentType = "application/octet-stream"
Dim blockSize As Integer = 104857600
Dim offset As Long = currentPartNumber * blockSize
Using inputStream As Stream = File.OpenRead(File)
inputStream.Seek(offset, SeekOrigin.Begin)
Dim buffer() As Byte = New Byte(blockSize - 1) { }
Dim count As Integer = inputStream.Read(buffer, 0, buffer.Length)
Return New MemoryStream(buffer, 0, count)
End Using
End Function
See the bottom of
this article[
^] for more details.