将日志文件 /可下载文件存储在Appliaintion Virtual Directory中是一个好习惯吗?
可以告诉我,存储IIS虚拟目录是一个好习惯吗?
在ASPNET MVC中,我们是Mainitaing Log Files,
1)我们可以将它们存储在该Web应用程序的虚拟指令中 2)我们可以选择从我的网站下载PDF文件,这是将它们存储在虚拟目录中的某些位置的好习惯。
请澄清
can any one tell me whether it is a good practice to store IIS Virtual directory .
in aspnet mvc , we are mainitaing log files ,
1)can we store them in virtual directry of that web application
2) we have an option to download pdf files from my website , is that a good practice to store them in some location in virtual directory.
please clarify
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
这取决于您的要求,但是在应用程序虚拟目录中存储日志文件和其他应用数据通常没有错。这样做确实有好处,例如自我启示。如果您的应用程序将日志作为文本文件生成,则通常在目录中创建一个日志文件夹。
至于需要从应用程序可以访问/可下载的数据文件,在ASP.NET(不是核心)中,您可以将它们存储在项目的
app_data
文件夹中,该文件夹是为此制定的,并从Web默认情况下。在ASP.NET Core中,您需要创建自己的文件夹并确保适当地保护它。有关后者的更多信息: app_data目录in ASP.NET5 MVC6It depends on your requirements, but there is generally nothing wrong with storing log files and other app data within your app's virtual directory. There are indeed benefits to doing so, such as self-containment. It is common to create a Logs folder within the directory if your app generates logs as text files.
As for data files that need to be accessible/downloadable from your app, in ASP.NET (not Core) you can store them within your project's
App_Data
folder, which is made for this and is secured from the Web by default. In ASP.NET Core, you'll need to create your own folder and ensure it is secured appropriately. More info on the latter here: App_Data directory in ASP.NET5 MVC6