[英]PDF is not accessible through URL in IIS .NET Framework 4.8 app
I spent few hours on this one without solving it.我在这个问题上花了几个小时没有解决它。 I have a PDF file that I need to be able to open through a link/url, like below:我有一个 PDF 文件,我需要能够通过链接/网址打开该文件,如下所示:
https://api.example.com/my-path/my-pdf-file.pdf https://api.example.com/my-path/my-pdf-file.pdf
The PDF file is hosted in a folder of my IIS application. PDF 文件托管在我的 IIS 应用程序的文件夹中。 Please advise...请指教...
Is the folder included in the project?该文件夹是否包含在项目中? You can't just add a folder outside of Visual Studio, but have to use VS to add that folder.您不能只在 Visual Studio 之外添加文件夹,而必须使用 VS 添加该文件夹。
You can right click on that existing folder (which of course is a sub folder of your project) and check this setting:您可以右键单击该现有文件夹(这当然是您项目的子文件夹)并检查此设置:
So, in my case, I right click on UpLoadFiles.因此,就我而言,我右键单击 UpLoadFiles。
If the folder ALREADY is included in the project, then you get a option to EXCLUDE the folder like this:如果文件夹已经包含在项目中,那么您可以选择排除该文件夹,如下所示:
However, if the folder is not included, then you see this:但是,如果该文件夹不包括在内,那么您会看到:
so, is that folder included in your project?那么,该文件夹是否包含在您的项目中? You want to check above.你想检查上面。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.