PageModel.PhysicalFile 方法

定义

重载

PhysicalFile(String, String)

返回由 physicalPath (Status200OK) 指定的文件,并将 指定 contentType 为 Content-Type。

PhysicalFile(String, String, String)

返回由 physicalPath (Status200OK) 指定的文件,指定的 contentType 作为 Content-Type,指定的 fileDownloadName 作为建议的文件名。

PhysicalFile(String, String)

Source:
PageModel.cs
Source:
PageModel.cs
Source:
PageModel.cs

返回由 physicalPath (Status200OK) 指定的文件,并将 指定 contentType 为 Content-Type。

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

文件的 Content-Type。

返回

为响应创建的 PhysicalFileResult

适用于

PhysicalFile(String, String, String)

Source:
PageModel.cs
Source:
PageModel.cs
Source:
PageModel.cs

返回由 physicalPath (Status200OK) 指定的文件,指定的 contentType 作为 Content-Type,指定的 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);
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

文件的 Content-Type。

fileDownloadName
String

建议的文件名。

返回

为响应创建的 PhysicalFileResult

适用于