PageModel.PhysicalFile 方法

定义

重载

PhysicalFile(String, String)

返回由 physicalPath Status200OK 指定为 Content 类型 () 指定的文件 contentType

PhysicalFile(String, String, String)

返回 () 指定的文件, physicalPath Status200OK 并将指定 contentType 为内容类型,并将指定 fileDownloadName 为建议的文件名。

PhysicalFile(String, String)

返回由 physicalPath Status200OK 指定为 Content 类型 () 指定的文件 contentType

public:
 virtual Microsoft::AspNetCore::Mvc::PhysicalFileResult ^ PhysicalFile(System::String ^ physicalPath, System::String ^ contentType);
public virtual Microsoft.AspNetCore.Mvc.PhysicalFileResult PhysicalFile (string physicalPath, string contentType);
abstract member PhysicalFile : string * string -> Microsoft.AspNetCore.Mvc.PhysicalFileResult
override this.PhysicalFile : string * string -> Microsoft.AspNetCore.Mvc.PhysicalFileResult
Public Overridable Function PhysicalFile (physicalPath As String, contentType As String) As PhysicalFileResult

参数

physicalPath
String

要返回的文件的物理路径。

contentType
String

文件的内容类型。

返回

PhysicalFileResult

PhysicalFileResult为响应创建的。

适用于

PhysicalFile(String, String, String)

返回 () 指定的文件, physicalPath Status200OK 并将指定 contentType 为内容类型,并将指定 fileDownloadName 为建议的文件名。

public:
 virtual Microsoft::AspNetCore::Mvc::PhysicalFileResult ^ PhysicalFile(System::String ^ physicalPath, System::String ^ contentType, System::String ^ fileDownloadName);
public virtual Microsoft.AspNetCore.Mvc.PhysicalFileResult PhysicalFile (string physicalPath, string contentType, string fileDownloadName);
abstract member PhysicalFile : string * string * string -> Microsoft.AspNetCore.Mvc.PhysicalFileResult
override this.PhysicalFile : string * string * string -> Microsoft.AspNetCore.Mvc.PhysicalFileResult
Public Overridable Function PhysicalFile (physicalPath As String, contentType As String, fileDownloadName As String) As PhysicalFileResult

参数

physicalPath
String

要返回的文件的物理路径。

contentType
String

文件的内容类型。

fileDownloadName
String

建议的文件名。

返回

PhysicalFileResult

PhysicalFileResult为响应创建的。

适用于