Overriding max file size in openmrs backend

does anyone know how to limit max file upload size in openmrs? in a typical spring application, I would just set


is there a way I can configure that using runtime properties?

@dkayiwa @mksd

Is it helpful to you ?

<beans:bean id=“multipartResolver” class=“org.springframework.web.multipart.commons.CommonsMultipartResolver”>

<beans:property name=“maxUploadSize” value=“26214400” /> </beans:bean>

If you are referring to this one, unfortunately we have not implemented configuring it using runtime properties.

You can try this in a module: Context.getRegisteredComponent("multipartResolver", CommonsMultipartResolver.class).setMaxUploadSize(size);

1 Like