部署后无法从IIS服务器下载文件。

问题描述:

我有一个项目,我从链接(某些*网站链接)下载文件。当我在本地主机中通过Visual Studio运行代码时,一切都是工作文件,并且能够从链接下载文件。但是,当我将代码部署到
IIS服务器并尝试从正常的本地系统访问它时,IIS不允许该文件被下载。我已经检查了IIS的所有权限,这些权限需要提供给文件应该下载的文件夹,但仍然不允许通过IIS下载
文件。我正在使用名为
URLDownloadToFile
的下载功能。

I have a project where I download a file from the link (Some Government Site Link). When I am running the code through Visual Studio in the local host everything is working file and am able to download the file from the link. But when I deploy the code to the IIS server and try to access it from the normal local system IIS is not allowing the file to get downloaded. I have checked all the privileges of IIS which needs to be given to the folder where the file should get downloaded still it is not allowing the file to get downloaded through IIS. I am using the download function called URLDownloadToFile.

有没有人可以帮我这个?

Could any one please help me on this ?

通常情况下,如果您正在下载并保存到您本地计算机上的文件,您将有权这样做。在Web服务器上,您需要为运行应用程序池的帐户设置这些权限。我不知道app
池在哪个帐户下运行,无论您使用的是默认帐户还是其他帐户,但这是您需要设置权限的帐户。
Typically if you are downloading and saving to a file on your local machine you would have permissions to do so. On a web server you would need to set these permissions for the account your app pool is running under. I don't know which account the app pool is running under, whether you are using the default account or a different account, but that is the account you would need to set permissions for.