拒绝用户访问文件夹 [英] Deny users to access a folder

查看:57
本文介绍了拒绝用户访问文件夹的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有这个上传文件结构链接localhost:58707/uploads/interaction/5/Chrysanthemum.jpg

I have this upload file structure link localhost:58707/uploads/interaction/5/Chrysanthemum.jpg

我想拒绝所有用户直接访问〜/上载".

I want to deny all the users to access '~/uploads' directly..

因此,我将其放在web.config中,就像我在其他问题中看到的那样:

So, I put this in my web.config as I see in others questions here:

  <location path="~/uploads"> //I've tried '/upload' and 'upload' too.
    <system.webServer>
      <directoryBrowse enabled="false" />
    </system.webServer>
  </location>

但是它不起作用.我该怎么办?

But it doesn't work. How can I do this?

推荐答案

选中此答案..

拒绝访问web.config中的"admin"文件夹

查看全文

登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆