I have a variable fileContent which holds the value of FileName. I want the filename value to be stored in separate variable. How can I do this using C#?
Please find below code: This is what I have tried :
var fileContent = provider.Contents.FirstOrDefault(c => c.Headers.ContentDisposition.Name.Replace("\"", "") == "file");
var fileName = fileContent.Headers.ContentDisposition.FileName.FirstOrDefault();
I am getting the integer value as 34 in the variable fileName - instead of "Test.txt".. Please help to fix this!