簡體   English   中英

嘗試下載文件時,找不到該網址的網頁

[英]No webpage was found for the web address when trying to download file

我有以下結構:

 AppName
    Content
       img
         file.png

我可以直接導航到mysite.com/Content/img/file.png沒有任何問題。

但是,當我將test.txt添加到img並設置為Copy Always並鍵入Content (與file.png相同)時,當我希望能夠使人們能夠訪問鏈接時,我得到No webpage was found for the web address就像圖片一樣,下載可公開訪問的文件(無需身份驗證)。 為什么這不起作用?

我可以在應用程序的bin文件夾中看到test.txt 是否需要配置其他功能以啟用直接文件下載?

確保您的IIS站點設置或web.config具有與.txt擴展名關聯的mime類型。

https://www.iis.net/configreference/system.webserver/staticcontent/mimemap

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM