如何为在 Alfresco 4.2.c 中上传的文件设置大小限制? [英] How can I set a size limit for files uploaded in Alfresco 4.2.c?
问题描述
我认为标题是不言自明的,现在...
I think the title is pretty self-explanatory, now...
我一直在寻找一种方法来限制通过共享在 Alfresco 4.2.c 中上传的文件大小.我很惊讶没有提供任何开箱即用的机制,在我看来这是一个非常基本的功能.
I have been looking for a way of limiting the size of files uploaded in Alfresco 4.2.c through Share. I'm surprised there isn't any mechanism provided out-of-the-box, looks to me a pretty basic feature.
根据此处讨论的内容,经过一些调查,我认为唯一可行的方法是实施自定义策略或行为:
After some investigation the only way I see to make it possible is by implementing custom policy or behavior, according to what's discussed here:
有人知道其他(更简单的)方法吗?
Do anybody knows any other (simpler) approaches?
正如 Andreas Steffan 所建议的,我在我的 share-config-custom.xml
中尝试了以下内容(例如将上传大小限制为 1MB):
As Andreas Steffan suggested, I tried the following in my share-config-custom.xml
(limiting the upload size to 1MB, for instance):
<config evaluator="string-compare" condition="DocumentLibrary" replace="true">
<!--
File upload configuration
-->
<file-upload>
<adobe-flash-enabled>false</adobe-flash-enabled>
<in-memory-limit>262144000</in-memory-limit>
<maximum-file-size-limit>1048576</maximum-file-size-limit>
</file-upload>
</config>
为了以防万一,我还在开箱即用的部署 share-documentlibrary-config.xml
中尝试了相同的配置,但没有成功.
Just in case, I also tried the same configuration without success in the out-of-the-box deployed share-documentlibrary-config.xml
.
推荐答案
假设它足以强制执行共享上传的大小限制,遵循 http://docs.alfresco.com/4.2/index.jsp?topic=%2Fcom.alfresco.enterprise.doc%2Fconcepts%2Fdev-extensions-share-module-dynamic-configuration.html 应该给你你想要的.
Assuming it is enough to enforce the size limit for uploads in share, following http://docs.alfresco.com/4.2/index.jsp?topic=%2Fcom.alfresco.enterprise.doc%2Fconcepts%2Fdev-extensions-share-module-dynamic-configuration.html should give you what you want.
把限制如
<in-memory-limit>262144000</in-memory-limit>
<maximum-file-size-limit>0</maximum-file-size-limit>
在 share-config-custom.xml
中,它应该很好.
in share-config-custom.xml
and it should be good to go.
这篇关于如何为在 Alfresco 4.2.c 中上传的文件设置大小限制?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!