I'm trying to make an ASP.NET 5 API that has a "Video" entity with four attributes:
public class Video
{
public Guid VideoId { get; set; }
public string Description { get; set; }
public long SizeInBytes { get; set; }
public string ContentPath { get; set; }
}
My questions are two:
Is it possible to store locally (in a folder in the solution) the file located in the path entered via POST REQUEST in the attribute
ContentPath
? If so, what is the easiest way to do this?Is it possible that the attribute
SizeInBytes
is automatically set according to the size of the file located in theContentPath
?