27 Nov 08:42
Re: How to change size limit for uploaded files
Hello Raquel,
When you start the Nuxeo server, the nuxeo.war folder is generated
again. So, if you modify the web.xml file when you start the server this
file is overrided.
So, you must create a new plugin to override this property.
I've done it using the following steps, I don't know if there is an easy
way:
To add a contribution to the web.xml file you have to use the
deployment-fragment.xml file from your extension project.
You can see the web.xml template in
{$NUXEO_EP_FOLDER}/server/default/deploy/nuxeo.ear/OSGI-INF/templates/web.xml
The size of the uploaded files is in the %{FILTER}% section. So, you
must overrided it with your new configuration. This section is defined
in the deployment-fragment from the nuxeo-platform-ui-web package.
Take a look to this file (you can find the package in the
/nuxeo.ear/platform folder) and copy in your deployment-fragment the
"<extension target="web#FILTER">" section. Attention: copy all the section.
To override it, you have to set the mode to replace. So you must have
something like that:
<extension target="web#FILTER" mode="replace">
...
<context-param>
<!-- Maximum disk space per request (in bytes) -->
<param-name>
org.apache.myfaces.trinidad.UPLOAD_MAX_DISK_SPACE
</param-name>
<!-- Use 20,000K -->
<param-value>Your new size</param-value>
</context-param>
</extension>
This plugin must be activated after the nuxeo-platform-ui-web package is
loaded. So, you have to add this module to the Require-Bundle section of
your MANIFEST.MF.
This is my MANIFEST.MF:
Manifest-Version: 1.0
Bundle-ManifestVersion: 1
Bundle-Name: maximumSizeUpload project
Bundle-SymbolicName: es.yerbabuena.maximumSizeUpload;singleton:=true
Bundle-Version: 1.0.0
Bundle-Vendor: Nuxeo
Provide-Package: es.yerbabuena
Require-Bundle: org.nuxeo.runtime,
org.nuxeo.ecm.core.api,
org.nuxeo.ecm.core,
org.nuxeo.ecm.webapp.core,
org.nuxeo.ecm.platform.ui
Nuxeo-Component:
You can see the name of the nuxeo-platform-ui-web component in its
MANIFEST.MF (the Bundle-SymbolicName).
If you deploy it and start the server you will see that the web.xml has
the right value now.
Another option is download the source code, modify the size in the
deployment-fragment of the nuxeo-platform-ui-web package, repackage this
module and copy it in the platform folder (delete the old package before).
Regards.
jiveforums-ecm@... wrote:
> Hello,
>
> I've seen that nuxeo limits the size for uploading files to 100M and I want to maximize it. I've tried to
change that limit rewritting the script that contains it (.../nuxeo.war/WEB-INF/web.xml) but
everytime I reboot the service it creates a new web.xml with the old value. Is there any easy way to change it
and be able to upload bigger files?
> Thanks in advance.
>
> Raquel
> --
> Posted by "rrgv" at Nuxeo Discussions <http://nuxeo.org/discussions>
> View the complete thread: <http://www.nuxeo.org/discussions/thread.jspa?threadID=2134#5803>
> _______________________________________________
> ECM mailing list
> ECM@...
> http://lists.nuxeo.com/mailman/listinfo/ecm
>
>
--
--
Enrique Pérez Olivares.
Dpto I+D.
Yerbabuena Software.
enriqueperez@...
http://www.yerbabuena.es
Tlf/Fax: 902 995 246
RSS Feed