Note

Access to this page requires authorization. You can try signing in or .

Access to this page requires authorization. You can try .

PhysicalFileResult Class

Definition

Namespace:
Microsoft.AspNetCore.Mvc
Assembly:
Microsoft.AspNetCore.Mvc.Core.dll
Package:
Microsoft.AspNetCore.Mvc.Core v1.0.0
Package:
Microsoft.AspNetCore.Mvc.Core v1.1.0
Package:
Microsoft.AspNetCore.App.Ref v10.0.0
Package:
Microsoft.AspNetCore.App.Ref v11.0.0-preview.4.26230.115
Package:
Microsoft.AspNetCore.Mvc.Core v2.0.0
Package:
Microsoft.AspNetCore.Mvc.Core v2.1.0
Package:
Microsoft.AspNetCore.Mvc.Core v2.2.0
Package:
Microsoft.AspNetCore.App.Ref v3.0.1
Package:
Microsoft.AspNetCore.App.Ref v3.1.10
Package:
Microsoft.AspNetCore.App.Ref v5.0.0
Package:
Microsoft.AspNetCore.App.Ref v6.0.36
Package:
Microsoft.AspNetCore.App.Ref v7.0.5
Package:
Microsoft.AspNetCore.App.Ref v8.0.19
Package:
Microsoft.AspNetCore.App.Ref v9.0.8
Source:
PhysicalFileResult.cs
Source:
PhysicalFileResult.cs
Source:
PhysicalFileResult.cs

Important

Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.

A FileResult on execution will write a file from disk to the response using mechanisms provided by the host.

public ref class PhysicalFileResult : Microsoft::AspNetCore::Mvc::FileResult
public class PhysicalFileResult : Microsoft.AspNetCore.Mvc.FileResult
type PhysicalFileResult = class
 inherit FileResult
Public Class PhysicalFileResult
Inherits FileResult
Inheritance
PhysicalFileResult

Constructors

Name Description
PhysicalFileResult(String, MediaTypeHeaderValue)

Creates a new PhysicalFileResult instance with the provided fileName and the provided contentType.

PhysicalFileResult(String, String)

Creates a new PhysicalFileResult instance with the provided fileName and the provided contentType.

Properties

Name Description
ContentType

Gets the Content-Type header for the response.

(Inherited from FileResult)
EnableRangeProcessing

Gets or sets the value that enables range processing for the FileResult.

(Inherited from FileResult)
EntityTag

Gets or sets the etag associated with the FileResult.

(Inherited from FileResult)
FileDownloadName

Gets the file name that will be used in the Content-Disposition header of the response.

(Inherited from FileResult)
FileName

Gets or sets the path to the file that will be sent back as the response.

LastModified

Gets or sets the last modified information associated with the FileResult.

(Inherited from FileResult)

Methods

Name Description
ExecuteResult(ActionContext)

Executes the result operation of the action method synchronously. This method is called by MVC to process the result of an action method.

(Inherited from ActionResult)
ExecuteResultAsync(ActionContext)

Executes the result operation of the action method asynchronously. This method is called by MVC to process the result of an action method. The default implementation of this method calls the ExecuteResult(ActionContext) method and returns a completed task.

Applies to


Feedback

Was this page helpful?