Get filename while downloading it

前端 未结 6 552
抹茶落季
抹茶落季 2020-12-13 13:59

We are providing files that are saved in our database and the only way to retrieve them is by going by their id as in:

www.AwesomeURL.com/AwesomeS

6条回答
  •  孤街浪徒
    2020-12-13 14:36

    You need to look at the content-disposition header, via:

    string disposition = client.ResponseHeaders["content-disposition"];
    

    a typical example would be:

    "attachment; filename=IDontKnowHowToGetTheRealFileNameHere.txt"
    

提交回复
热议问题