It is necessary to make a link to download the file not from the server itself, but from the local network where the server is located:

<a href="//192.168.88.220/Files/РУ_2_кл_Работы.zip">РУ_2_кл_Работы</a> 

I was somewhat surprised that it was not so easy to do .

Is there a way to achieve this?

I also tried various file:/// file:\\\ usage cases. Does not help.

  • Uh, is host 192.168.88.220 available to server clients? If yes, file:/// should work (although I haven't tried it). - VladD
  • @VladD did: <a href="file:///\\192.168.88.220\файлы_пто\Работы\[2016-15] - ДР в 1-3 классов\2 класс\РУ_2 кл_Памятка учителю.docx">РУ_2_кл_Памятка учителю</a> . Does not work. - Adam
  • And for the sake of interest, if the path is all from Latin? And what exactly does “not work” mean? - VladD
  • @VladD, it works here ... security limitations. You cannot use http: to file: - Qwertiy
  • @Qwertiy: Ah, that's it! Even in external links of type a href= ? - VladD

2 answers 2

Make a separate controller method and there’s something like this:

 public FileResult Download() { byte[] fileBytes = System.IO.File.ReadAllBytes(@"//192.168.88.220/Files/РУ_2_кл_Работы.zip"); string fileName = "some_english_name.zip"; return File(fileBytes, System.Net.Mime.MediaTypeNames.Application.Octet, fileName); } 

those. the request will go to the server, the server will access the network resource and give the file

    Try this:

     <a href="\\192.168.88.220\Files\РУ_2_кл_Работы.zip">РУ_2_кл_Работы</a> 
    • Try to write more detailed answers. Explain what is the basis of your statement? - Nicolas Chabanovsky