Change name of file sent to client?

后端 未结 4 1334
说谎
说谎 2020-12-17 23:22

I have a webpage that pulls information from a database, converts it to .csv format, and writes the file to the HTTPResponse.

string csv = GetCSV();
Respon         


        
4条回答
  •  野趣味
    野趣味 (楼主)
    2020-12-17 23:31

    I believe this will work for you.

    Response.AddHeader("content-disposition", "attachment; filename=NewFileName.csv");
    

提交回复
热议问题