[FileType]
IntelliTect.Coalesce.DataAnnotations.FileTypeAttribute
Specify the allowed file types for a file method parameter. The value is passed through to the "accept" attribute of an HTML File Input. This does not implement any server-side validation of file content.
Example Usage
c#
public class Person
{
public int PersonId { get; set; }
public async Task UploadProfilePicture([FileType("image/*")] IFile file)
{
}
}
Properties
// Also settable via constructor parameter #1
public string FileTypes { get; set; }
// Also settable via constructor parameter #1
public string FileTypes { get; set; }
Comma-delimited list of Unique file type specifiers.
Examples:
"image/*"
- Common image formats.pdf,application/pdf
- PDF Files.doc,.docx,application/msword,application/vnd.openxmlformats-officedocument.wordprocessingml.document
- Microsoft Word Documents