Problem with the maximum file upload size

652 views
Skip to first unread message

Javi Rojo Díaz

unread,
Jun 12, 2024, 6:04:14 AM6/12/24
to DSpace Technical Support
Good morning. 

We are having problems uploading files to items in DSpace 7.6, and it seems that it's due to the upload file size limit. Based on the tests I've been doing, it gives an error when the file is over 500MB.

Is it correct that the file size limit is 500MB? If so, can this limit be increased and where would it be configured? 


Thank you very much, everyone!

Julio

unread,
Jun 12, 2024, 9:02:47 AM6/12/24
to DSpace Technical Support
Hello, to change the maximum size of the files that can be uploaded to Dspace, you must edit the dspace.cfg file and modify the parameter: upload.max, this value must be in bytes, if you set -1, there will be no limit.

I hope it is useful to you.

Greetings

hb wooley

unread,
Jun 12, 2024, 9:14:00 AM6/12/24
to DSpace Technical Support
You can add the below to your dspace/config/local.cfg

# EXAMPLE OVERRIDE:
# By uncommenting the below Spring Boot settings, you can increase or decrease the maximum upload size.
# These defaults are specified in [dspace-src]/dspace-server-webapp/src/main/resources/application.properties
# but may be overridden in this local.cfg
#
# Maximum size of a single uploaded file (default = 1MB)
spring.servlet.multipart.max-file-size = 512MB

# Maximum size of a multipart request (i.e. max total size of all files in one request) (default = 10MB)
spring.servlet.multipart.max-request-size = 512MB

You might also need to modify your web server configuration (ssl.conf) 
Apache 2.4.6 example:
<Location /uplopad_location>
  #LimitRequestBody bytes
  LimitRequestBody 524295 
</Location>
Nginx example:
location /uploads { 
  client_max_body_size 512M; 
}

I did not know about the  upload.max (Julio) in the dspace.cfg. See dspace-api/src/main/java/org/dspace/submit/model/UploadConfiguration.java

BW

DSpace Technical Support

unread,
Jun 12, 2024, 10:55:29 AM6/12/24
to DSpace Technical Support
The answer here depends on the version of DSpace.  The "upload.max" setting only works in DSpace 6 and below.

As of DSpace 7 (and above), the correct settings are those "spring.servlet.*" settings detailed by BW.  This is because the file upload limitations are now enforced by Spring Boot.

Javi Rojo Díaz

unread,
Jun 12, 2024, 11:47:33 AM6/12/24
to DSpace Technical Support

Hello,

 I have added the following lines in dspace.cfg, restarted Tomcat, and it is already working. I have been able to upload documents larger than 512MB. 


# Maximum size of a single uploaded file (default = 1MB)
spring.servlet.multipart.max-file-size = 1024MB


# Maximum size of a multipart request (i.e. max total size of all files in one request) (default = 10MB)
spring.servlet.multipart.max-request-size = 2048MB


Thank you all very much!
Reply all
Reply to author
Forward
0 new messages