I'm trying to communicate with a system which I have no control over, however one of it's methods takes in a HttpPostedFile were in my code I have a byte array. Does anybody have an example of instantiating a HttpPostedFile as I know it's constructor is internal?
The best I've found is this SO post which uses reflection however they were steered into another direction which I can't take because I am unable to modify the third party systems method signature.
you can try
obj
would of typeHttpPostedFile
.I'm setting the last parameter to null but it has to be a HttpInputStream though.This is really really hacky code, but the following seems to work for me: