confiforms uploads files/images max size - error
Asked by Ilcin:

Hi,

I'm using Confiforms as a print request, where others upload their files with the Confiforms Form Field Definition set to Files - upload files/images so that I can print them. While testing for the maximum file size I got an error  
"Operation has failed. Error communicating with the server. (error). Please check Confluence server logs for more details."

The file was about 40MB, does that mean there is a size limit (I read that Confiforms has none?), if there is a size limit, what exactly is it?

Thanks in advance!  


Answers:
author: Shannon S
body: Hello Ilcin,

Thank you for contacting us. The maximum file size for attachments is 100 MB and can be configured in your Confluence administration:

* [Configuring Attachment Size](https://confluence.atlassian.com/doc/configuring-attachment-size-150040.html)

> **To configure the maximum file size that can be uploaded:**
>
> 1. Go to ![](https://confluence.atlassian.com/doc/files/747833194/747833195/2/1517274813281/cog.png) \> **General Configuration**.
>
> 2. Choose **Edit**.
> 3. Enter the maximum size next to **Attachment Maximum Size** .  
>    The default is 100 MB.
>
> 4. Choose **Save**.

If you can confirm that your file size isn't lower than 40 MB, then I would recommend having a look at your [Confluence server logs](https://confluence.atlassian.com/doc/working-with-confluence-logs-108364721.html) in order to see what the error is that is generating that message in your UI. You will want to trigger the error again and then see what error occurs directly after that.

Thank you for your help!

Regards,

Shannon

comments: author: Ilcin
body: Hello Shannon,

thank you for your answer! Sadly I don't have the according permissions to see the Confluence administration, but I know where to find it now. Thanks to trial and error I found out that our settings are actually set to 40 MB.

Is there a way for users without administration rights to be able to see the maximum attachment size? Because that could have spared me a lot of time.

Thank you!

Best regards,

Ilcin


author: Shannon S
body: Hello Ilcin,

Thank you for following up. Unfortunately, there is nowhere you'd be able to see the attachment limit without being an administrator. We did previously have a feature request for this, but it has since been closed and will not be implemented in the near future.

* [CONFSERVER-20681](https://jira.atlassian.com/browse/CONFSERVER-20681) *Show maximum attachment size to the user in attachment form*

However, we have another feature request for Confluence to check the attachment size first, before attempting the upload:

* [CONFSERVER-14317](https://jira.atlassian.com/browse/CONFSERVER-14317) *Check Attachment size prior to starting upload*

Please vote on the request and you will automatically be added to the Watchers list. You will then be informed of any updates in the future.

I hope that helps, but do let me know if you have any concerns.

Regards,

Shannon


author: Ilcin
body: Hello Shannon,

thank you so much for your answer, I will check the request out!

Best regards,   
Ilcin


author: Alex Medved _ConfiForms_
body: You can (**and should!!!**) set the rules in ConfiForms forms for the files you accept from your users

This can be done by adding the ConfiForms Field Definition Rules macro and checking the size of the file on upload. Of course the limits shall be lower than maximum accepted for attachments in Confluence

For example (my field for attachments is called "myfile" here)

```
 <ac:structured-macro ac:macro-id="812b18f3-6d41-48a7-80f2-df0c1634d0c9" ac:name="confiform-field-definition-rules" ac:schema-version="1">
<ac:parameter ac:name="condition">myfile.asAttachment.fileSize:&gt;10000</ac:parameter>
<ac:parameter ac:name="fieldName">File is too big</ac:parameter>
<ac:parameter ac:name="action">Validation rule</ac:parameter>
</ac:structured-macro>
```

This rule checks if the file size is larger than 10000 bytes and shows an error message when it is ("File is too big")

Visually it looks like this

![Screenshot 2019-06-06 at 12.16.49.png](https://community.atlassian.com/t5/image/serverpage/image-id/56831iAAA50FD8D9DBA0A8/image-dimensions/593x327?v=v2 "Screenshot 2019-06-06 at 12.16.49.png")

![Screenshot 2019-06-06 at 12.16.59.png](https://community.atlassian.com/t5/image/serverpage/image-id/56830i95ECF4FC1AE5FE81/image-dimensions/595x264?v=v2 "Screenshot 2019-06-06 at 12.16.59.png")

comments: author: Ilcin
body: Hello Alex,

what is the reason so that I should set the rules in Confiforms form?  
Because my main issue was not knowing the max. size despite working with Confiforms but having no admin rights to actually look it up, resulting in trial and error.

Also when I have one entry with the maximum attachment size in my form already, and I create another entry with a new attachment, the max. file size doesn't allow another one. Is the max. file size therefore per user? And not per entry?

Thanks in advance!

Best regards  
Ilcin


author: Alex Medved _ConfiForms_
body: Because it is a good practice to set the limits on what you accept and validate the inputs.

And also, we don't set the limits in ConfiForms, but we are bounded by the limits set by Confluence itself.

Limits are per file/attachment. As the file uploaded with ConfiForms gets attached to the page and attachment size limits apply


Tags: atlassian-marketplace

confiforms

developer

error

maximum

size

upload