Uploaded attachments can't be viewed and downloaded attachments give network error
Platform notice: Server and Data Center only. This article only applies to Atlassian products on the Server and Data Center platforms.
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
Problem
- Uploaded attachments cannot be displayed.
- Preview shows an Ouch! We can't load the image. message.
- Downloaded attachments generate a network error.
The following appears in the atlassian-confluence
.log
2016-04-07 14:34:48,501 ERROR [http-nio-8090-exec-6] [[Standalone].[localhost].[/].[file-server]] log Servlet.service() for servlet [file-server] in context with path [] threw exception
java.lang.NullPointerException
at com.atlassian.confluence.importexport.resource.ExportDownloadResourceManager.getExportRoot(ExportDownloadResourceManager.java:99)
at com.atlassian.confluence.importexport.resource.ExportDownloadResourceManager.matches(ExportDownloadResourceManager.java:31)
at com.atlassian.confluence.importexport.resource.DelegatorDownloadResourceManager.getResourceReaderFromDelegate(DelegatorDownloadResourceManager.java:67)
at com.atlassian.confluence.importexport.resource.DelegatorDownloadResourceManager.getResourceReader(DelegatorDownloadResourceManager.java:30)
at com.atlassian.confluence.servlet.download.AttachmentDownload.getStreamForDownload(AttachmentDownload.java:71)
...
Cause
The parameter
<property name="webwork.multipart.saveDir">${confluenceHome}/temp</property>
is missing from confluence.cfg.xml
.
Resolution
- Shut down Confluence
Edit <local-home>
/confluence.cfg.xml
and add (or edit to match) the lineconfluence.cfg.xml<property name="webwork.multipart.saveDir">${localHome}/temp</property>
- Restart Confluence.