Increase size of uploading ressources

Hi there,
i tried to upload some files to my dhis2 instances using report ressources but this last has limit size , so is there any way to change this setting.

thank you

Welcome back the community @ssari!

What’s the limited size that you are being faced with?

The File Resources api endpoint can be used to store large files:

“The contents of file resources are not directly accessible but are referenced from other objects (such as data values) to store binary content of virtually unlimited size.” (source)


Please feel free to share more details about the use case (what and why you are trying to achieve using these uploads.) As sharing the use case helps with the community discussion and encourages creation of feature requests.

Thanks!

1 Like

Hi @ssari,

I would appreciate it if you could please elaborate on the issue.
I would like to know the following points:

  1. What is the exact error that you are getting?
  2. Are there any limitations or restrictions from the server side on the size limit upload?
  3. Is the application being deployed properly?
  4. Did you do a configuration change in the environment that led to this problem? Or the issue is shown for the first time?

Thanks

1 Like

Hi,
so here what im getting when i upload my file
ps: its size is about 33Mb and i noticed just small size files can be uplaoded

@ayman.tuffaha yes the application is deployed proprely and i didn’t make any change in the environment

thank you

Thanks @ssari,

What version number of DHiS2 you are using? could you please translate the error in red into English? :grin:

BR,
Ayman

@ayman.tuffaha
Im using DHIS 2.37.2
the message error is : “An error occurred while adding the resource!”

1 Like

This is typically controlled by nginx (or whichever reverse proxy you have deployed). The directive to set for nginx is:

client_max_body_size 100M;

You can obviously set the directive to whatever max limit you prefer, and set it either on the server or location block in nginx.

You might even want to create more specific location blocks for the /api/fileResources API endpoint to ensure large files cannot be sent or uploaded elsewhere.

There are multiple guides online regarding this topic. Nginx docs here:

http://nginx.org/en/docs/http/ngx_http_core_module.html#client_max_body_size

best,

Lars

3 Likes

Thank you @Lars it solved my issue

3 Likes