I have an HttpPostedFile object and just need to extract the content of the posted file.
I found this link but that's a very long process to just obtain a string with the content.
Is there any shorter way? (Preferably, a one line instruction.)
I have an HttpPostedFile object and just need to extract the content of the posted file.
I found this link but that's a very long process to just obtain a string with the content.
Is there any shorter way? (Preferably, a one line instruction.)
var str = new StreamReader(postedFile.InputStream).ReadToEnd();
postedFile.InputStream.Position = 0
) as this was the second time on the code reading the content. Thanks again @LenielMacaferi and @AlexeiLevenkov –
Allstar © 2022 - 2024 — McMap. All rights reserved.