I have a physical path to a file.
c:\fullpath\filename.jpg
But when using:
context.Response.WriteFile(fullPath)
I end up with stuff like:
Õ"+*Br¾Ì˜0|-9ÇáæfáU®Ån¿aÙ޽njÞöôþ½òÀ)"™G¦Ù0k6Í\fÃx›Ífz0]kEþÏÚª‰“Ù{^Æú™‹*òòç (?&:o‘Už%8x8ÜØ#g
In the browser.. Of course, a whole lot more of it.
I know it's a broad question, but hoping someone might be able to spot what the issue might be based on the above. My actual code is massive, and much more complex, so something is messing it up, and too much to try to parse through and explain on here, so again... Just hoping someone might have an idea as to why this is happening just based on what I've shown above.
You're writing the content of a binary file to the response. We don't know what else you've written to the response, or what you've set the content type to. If your response content type is text/plain or something similar, then that's the problem. If you make the content type reflect the actual kind of content you're putting in the response, it should be fine.
Of course, you shouldn't include data like this in the midst of a response which also contains HTML etc - unless you're doing something very odd, this should be the only data in the response.
See more on this question at Stackoverflow