gpt4 book ai didi

c# - asp.net mvc 文件内容类型

转载 作者:IT王子 更新时间:2023-10-29 04:52:48 25 4
gpt4 key购买 nike

  public ActionResult MyFile(string MetaValue,int OrganizationId=0)
{
OrganizationUsersDataContext OrgMeta = new OrganizationUsersDataContext();
JobsRepository JobsRespository = new JobsRepository();
string CvPath = JobsRespository.GetCvPath();
var FilePathForOrganization = OrgMeta.OrganizationMetas.FirstOrDefault(m => m.bit_IsDeletable == true && m.int_OrganizationId == OrganizationId && m.vcr_MetaKey == "PhysicalPath");
string CompletePhysicalPath = FilePathForOrganization.vcr_MetaValue + CvPath + MetaValue ;
return File(@CompletePhysicalPath,"");

}

My File可以返回doc,docx或者pdf,内容类型有什么。这是给问题。

最佳答案

这是一个 ContentType 列表,您可以使用它们传回您的 View

http://www.wiley.com/legacy/compbooks/graham/html4ed/appb/mimetype.html

Word (.doc)

应用程序/msword

Word (.docx)

application/vnd.openxmlformats-officedocument.wordprocessingml.document

PDF (.pdf)

应用程序/pdf

关于c# - asp.net mvc 文件内容类型,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/4304241/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com