Overriding default multipart file size in Openmrs module dev

(Samuel Male) #1


With the mergepatientdata module, you can export a good number of patient and encounter, I dowloaded over 2000+ patients with their encounter and these made up a file of around 89mbs, on trying to upload this file file to another server, I hit upon this

 org.springframework.web.multipart.MaxUploadSizeExceededException: Maximum upload size of 75000000 bytes exceeded; nested exception is org.apache.commons.fileupload.FileUploadBase$SizeLimitExceededException

I thought by default the spring multipart system has no limit!

However, I tried to override this by adding this bean in my webModuleApplicationContext.xml

<bean id="multipartResolver" class="org.springframework.web.multipart.commons.CommonsMultipartResolver">
	<property name="maxUploadSize" value="-1"/>

I expect that to set it to an infinite value but actually this doesn’t work :flushed:

Could I be missing something?

cc: @wyclif , @dkayiwa

Design Forum 2018-09-26: Improving on Memory Management in the mergepatientdata module
Design time for Improving on Memory Management in the mergepatientdata module
Propose a Design Forum Topic
GSoC 2018 - Merge Patient Data from Multiple Installations - Final Presentation
(Daniel Kayiwa) #2

Did you eventually decide to use a different approach?

(Samuel Male) #3

I had not taken any progress on this, I was still caught up in the ‘box’. Just created a ticket to address that. Could be thats the first ticket I will handle this week.

@dkayiwa, @ssmusoke

(Herbert Yiga) #4


have you tried to use a bigger value within property?

(Samuel Male) #5

Yes @herbert24 :smile:

(Herbert Yiga) #6


i was having the same error some day and putting a bigger value under property solved my problem

(Samuel Male) #7

Were you dealing with an openmrs module? @herbert24

(Herbert Yiga) #8

(Herbert Yiga) #9

can i post you some thing get on irc

(Samuel Male) #10

Just can’t see you there. You could want to share from this thread @herbert24