Step1.
打开communityserver.config,找到
<Forums>
<AttachmentSettings
enableFileSystemStorage="true" fileSystemStorageLocation="~/forums/storage"
enableDataStoreStorage="true" enableDirectLinks="true" />
</Forums>
修改enableDirectLinks="true"为enableDirectLinks="false"
Step2.
打开web.config,在倒数第二行之前添加如下代码
<location path="forums/PostAttachment.aspx">
<system.web>
<authorization>
<deny users="?" />
</authorization>
</system.web>
</location>
Step3.
更新两个文件即可。
communityserver.config里面的<Forums>节的其他配置说明
enableFileSystemStorage="true",启用文件存储(把附件以文件形式存储在服务器上)
fileSystemStorageLocation="~/forums/storage" ,文件存储路径
enableDataStoreStorage="true",启用文件存储(存储在数据库中,如果数据库有限制可以设定为false)
引用自:http://xuevb.net/blogs/announcements/archive/DisAlowAnonymousToDownAttachments.aspx