Upload attachment function does not work in editing mode

Platform Notice: Data Center Only - This article only applies to Atlassian products on the Data Center platform.

Note that this KB was created for the Data Center version of the product. Data Center KBs for non-Data-Center-specific features may also work for Server versions of the product, however they have not been tested. Support for Server* products ended on February 15th 2024. If you are running a Server product, you can visit the Atlassian Server end of support announcement to review your migration options.

*Except Fisheye and Crucible

Summary

Unable to upload attachments from the Editor via either:

  • Edit page > Insert > Attachment

  • Edit page > Insert > Image

  • Edit page > Insert files and images > click on Upload files

You get the error message: "Could not upload the file to Confluence. The server may be unavailable."

Note: sometimes the attachment will upload despite the warning.

Screenshot showing 'Insert files and images' modal. There is an error message 'Could not upload the file to Confluence. The server may be unavailable.

You can successfully upload attachments from Tools > Attachments > Attach File.

Diagnosis

The following appears in the atlassian-confluence.log:

012-09-18 19:06:10,170 ERROR [http-8090-4] [atlassian.confluence.servlet.ConfluenceServletDispatcher] serviceAction There is no Action mapped for namespace /confluence/pages and action name attachfile -- url: /confluence/pages/attachfile.action | userName: florianmayer | referer: http://atlassian.net:8090/pages/createpage.action?spaceKey=ds&fromPageId=121962498 2012-09-18 19:07:19,242 ERROR [http-8090-4] [atlassian.confluence.servlet.ConfluenceServletDispatcher] serviceAction There is no Action mapped for namespace /confluence/pages and action name attachfile -- url: /confluence/pages/attachfile.action | userName: florianmayer | referer: http://atlassian.net:8090/pages/createpage.action?spaceKey=ds&fromPageId=121962498 2012-09-18 19:09:18,465 ERROR [http-8090-4] [atlassian.confluence.servlet.ConfluenceServletDispatcher] serviceAction There is no Action mapped for namespace /confluence/pages and action name attachfile -- url: /confluence/pages/attachfile.action | userName: florianmayer | referer: http://atlassian.net:8090/pages/createpage.action?spaceKey=ds&fromPageId=121962498

Additional diagnosis:

  1. Open the Browser Developer tools to the Network tab

  2. On the Edit screen load, check if there are any HTTP failures on any batch.js calls after the resources call:

    Screenshot showing a Confluence DC page being edited in a browser. The browser web developer tools are open to the 'Network' tab. There is a call to 'batch.js' that is failing with a HTTP 400 response

    Look for any errors such as HTTP 400, HTTP 0 on the batch.js calls

Cause

Solution

Solution 1

Ensure that the configured base URL must match the URL you use to access Confluence via the browser. Update the Base URL from Confluence Admin > General Configuration.

Also check that the <confluence-install-dir>/conf/server.xml has the relevant proxyName, proxyPort and scheme tags. Refer to the relevant Proxy and HTTPS setup for Confluence guides.

Solution 2 - IIS

2.1. IIS not using AJP worker

  1. Open up IIS Manager

  2. Navigate to the Confluence "site"

    • Right click and clickExplore

    • Edit the web.config file in a text editor

      • Make sure in the <system.web> block, there is a value for maxUrlLength="4096", e.g.

        <?xml version="1.0" encoding="UTF-8"?> <configuration> <system.webServer> <rewrite> ... </rewrite> <security> ... </security> </system.webServer> <system.web> <!-- This keeps IIS from complaining about special characters in the url. Also has some controls for max upload size. Set to the equivalent of the above, but in kilobytes instead of bytes. (ex. 61440 = 60MB) --> <httpRuntime executionTimeout="20" maxUrlLength="4096" maxRequestLength="100000" requestPathInvalidCharacters="" requestValidationMode="2.0" /> <pages validateRequest="false" /> </system.web> </configuration>
  3. Once the above is done, restart the "IIS service" for the change to take effect

2.2. IIS is using AJP worker

  1. Open up regedit.exe from Start Menu on the Windows IIS Server

  2. Navigate to HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\HTTP\Parameters

  3. Create a new DWORD (32-bit) value

    1. Name: UrlSegmentMaxLength

    2. Value: 1000 (hex) or 4096 (decimal)

  4. Reboot the entire Windows machine for the registry change to take effect

Solution 3

As per Using Antivirus software with Confluence:

  • Disable/Uninstall Symantec Endpoint and/or Trend Micro antivirus scanner from the Confluence Server; or

  • Exclude The Tomcat listening port from being scanned; or

  • Edit the Trend Micro AV / URI Length and Depth restriction rule to allow long URI length (e.g. set to 1024):

    Screenshot from an AV/network security service showing that the URI length can be manually configured
    Screenshot from an AV/network security service showing that the URI length configuration

Workaround

Enable Safe-Mode and see if the upload functionality works after disabling third party add-ons.

Updated on June 11, 2025

Still need help?

The Atlassian Community is here for you.