简体   繁体   中英

C# download special character file name files from server

Hi I have my files in server and file names on DB ....files without special characters I am able to download from server using html download by binding href ....but for special characters file name its not possible to download..please give me suggestion to do...

I have tried using linkbutton ...which I already created controls in aspx page and binding file name to it...but for multiple files its not working ....all files getting single click ...which file is clicked I am not able to get it...please help me in this

您需要使用Url.Encode创建URL

<a href="https://www.example.com/controller/action?filename=@Url.Encode(Model.FileName)">Click Here to download the file</a>

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM