Partager via


FileContentResult Constructor

Initializes a new instance of the FileContentResult class by using the specified file contents and content type.

Namespace:  System.Web.Mvc
Assembly:  System.Web.Mvc (in System.Web.Mvc.dll)

Syntax

'Declaration
Public Sub New ( _
    fileContents As Byte(), _
    contentType As String _
)
public FileContentResult(
    byte[] fileContents,
    string contentType
)
public:
FileContentResult(
    array<unsigned char>^ fileContents, 
    String^ contentType
)

Parameters

  • fileContents
    Type: System.Byte[]
    The byte array to send to the response.
  • contentType
    Type: System.String
    The content type to use for the response.

Exceptions

Exception Condition
ArgumentNullException

The fileContents parameter is null reference (Nothing in Visual Basic).

See Also

Reference

FileContentResult Class

System.Web.Mvc Namespace