I\'m trying to communicate with a system which I have no control over, however one of its methods takes in a HttpPostedFile were in my code I have a byte array. Does anybody
you can try
var constructorInfo = typeof(HttpPostedFile).GetConstructors(BindingFlags.NonPublic | BindingFlags.Instance)[0];
var obj = (HttpPostedFile)constructorInfo
.Invoke(new object[] { "filename", "image/jpeg", null });
obj would of type HttpPostedFile .I'm setting the last parameter to null but it has to be a HttpInputStream though.