My code:
public class UplaodedFile
{
public UploadedFile File = null;
public string Description = null;
public string OriginalFileName = null;
public byte[] inputStream ;
public UplaodedFile(UploadedFile file, string desc, string FileName, byte[] inputStream)
{
File = file;
Description = desc;
OriginalFileName = FileName;
inputStream = inputStream;
}
}
I am creating an object as below:
UplaodedFile uploadedfile = new UplaodedFile(uploaded_file, description, originalFileName, file_contents);
and when I try to access the uploadedfile.inputStream, I am getting null.
What am I doing wrong?
InputStreamwhich should be done anyway because it'spublic. But you should not have public fields, instead use properties. Read why properties matter