对文件的访问受到限制

发布于 2024-10-06 05:00:13 字数 135 浏览 0 评论 0原文

我读到,如果你想给你的用户一个没有人可以通过 url 访问的文件,你需要将它放在域上层的目录中。

在我的计算机上它可以工作,但是当我在线尝试时,我得到的是domain.com,之后我需要将文件夹提升2级,

正确的方法是什么?

i read that if you want to give your users a file that nobody can access via url, you need to put it in a directory in an upper level of the domain.

on my computer it worked but when i have tried that online what i got is the domain.com and after that the folder that i needed to be 2 levels up

what is the right way to do it?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

π浅易 2024-10-13 05:00:13

服务器上与 Web 根目录相关的文件在哪里?例如,如果您的 Web 根目录是 C:\inetpub\wwwroot\MyApplication\,那么您需要将文件放在该目录之外(否则,它们会像任何其他文件一样共享)。然后,在 ASP 代码中,您将通过在代码中读取该文件并将其输出给有权访问该文件的用户来控制对该文件的访问。

听起来你说你已经在本地机器上运行了后一部分,是这样吗?服务器上到底是怎么失败的?

Where are the files on the server in relation to the web root? For example, if your web root is C:\inetpub\wwwroot\MyApplication\ then you'll want to put the files outside of that directory (otherwise, they're shared like any other file). Then, in your ASP code, you'll control access to that file by reading it in the code and outputting it to users who are permitted to access it.

It sounds like you say you have that latter part working on your local machine already, is that the case? How exactly is it failing on the server?

我一向站在原地 2024-10-13 05:00:13

如果您不希望任何 URL 都可以访问它,则根本不要将其放入您的 Web 服务器域中。如果您希望仅某些人可以访问它,那么您需要研究某种身份验证/授权技术。

If you don't want it accessible by any URL from any one, then don't put it in your web server domain at all. If you want it accessible by only certain people, then you need to look into some kind of authentication / authorization technique.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文