gpt4 book ai didi

c#根据下载请求动态重命名文件

转载 作者:太空狗 更新时间:2023-10-29 17:45:27 25 4
gpt4 key购买 nike

尝试下载文件时是否可以重命名文件?例如,我想使用文件的 ID 将文件存储到文件夹中,但是当用户下载文件时,我想返回原始文件名。

最佳答案

在这里修改文件名

Response.AppendHeader("Content-Disposition","attachment; filename=LeftCorner.jpg");

例如

 string filename = "orignal file name.ext";
Response.AppendHeader("Content-Disposition","attachment; filename="+ filename +"");

Downloading a File with a Save As Dialog in ASP.NET

关于c#根据下载请求动态重命名文件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/3084567/

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