Confluence 上传大一点的附件显示HTTP Error

上传附件显示HTTP Error 。

一般几Mb的是可以的,但是上传30Mb以上的就会显示HTTP Error。目前系统配置是文件大小限制是100Mb。之前上传90Mb都是可以成功的。最近才出现这个问题。

 

 

有几个地方你可以考虑这个问题。

你可以 F12 看你的浏览器,在是上传文件的时候,你的浏览器应该不会出现错误提示信息。

 

 

尝试不要上传 Docx 文件,你可以尝试上传一些图片文件。这是因为你如果你上传 Doc 或者 PPT 文件的话,Confluence 会尝试进行转换。

通过这个你可以看看是不是因为文件格式不支持。

访问 Confluence 后台的 Troubleshooting and support tools,然后进行日志分析,查看 Confluence 有没有提示什么错误。

 

 

如果你使用了反向代理的话,你需要看看你的 Apache 或者 Nginx 可以支持的上传文件大小是否超出了限制。

因为前台界面的问题有点笼统,所以你需要找到具体问题出现在哪里,才可以对症修改了。

https://www.ossez.com/t/http-error/164/2

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论
好的,以下是一个简单的上传附件的java代码示例: ```java import com.atlassian.confluence.api.ConfluenceApi; import com.atlassian.confluence.api.model.content.Content; import com.atlassian.confluence.api.model.content.ContentType; import com.atlassian.confluence.api.model.content.ContentBody; import com.atlassian.confluence.api.model.content.ContentCreationRequest; import com.atlassian.confluence.api.model.content.ContentUpdateRequest; import com.atlassian.confluence.api.model.content.Space; import com.atlassian.confluence.api.model.content.SpaceSummary; import com.atlassian.confluence.api.model.content.SpaceUpdateRequest; import com.atlassian.confluence.api.model.content.Upload; import com.atlassian.confluence.api.model.content.id.ContentId; import com.atlassian.confluence.api.model.content.id.SpaceId; import com.atlassian.confluence.api.model.exception.ForbiddenException; import com.atlassian.confluence.api.model.exception.InvalidRequestException; import com.atlassian.confluence.api.model.exception.NotFoundException; import com.atlassian.confluence.api.model.exception.PermissionException; import com.atlassian.confluence.api.model.exception.RateLimitExceededException; import com.atlassian.confluence.api.model.exception.ServerErrorException; import com.atlassian.confluence.api.model.exception.UnknownException; import com.atlassian.confluence.api.model.pagination.Pagination; import com.atlassian.confluence.api.model.person.Person; import com.atlassian.confluence.api.model.person.UserDetails; import com.atlassian.confluence.api.model.person.Username; import com.atlassian.confluence.api.model.permissions.PermissionCheckResult; import com.atlassian.confluence.api.service.content.ContentService; import com.atlassian.confluence.api.service.content.SpaceService; import com.atlassian.confluence.api.service.search.SearchService; import com.atlassian.confluence.api.service.user.UserService; import com.atlassian.fugue.Option; import java.io.File; import java.io.FileInputStream; import java.io.IOException; import java.io.InputStream; import java.util.Arrays; public class ConfluenceAttachmentUploader { private final ConfluenceApi confluence; private final String pageTitle; private final String pageContent; private final String attachmentFilePath; public ConfluenceAttachmentUploader(ConfluenceApi confluence, String pageTitle, String pageContent, String attachmentFilePath) { this.confluence = confluence; this.pageTitle = pageTitle; this.pageContent = pageContent; this.attachmentFilePath = attachmentFilePath; } public void uploadAttachment() throws IOException, PermissionException { // Create page content ContentBody contentBody = ContentBody.builder() .value(pageContent) .representation(ContentBody.Representation.STORAGE) .build(); ContentCreationRequest contentCreationRequest = ContentCreationRequest.builder() .space(confluence.getContentService().find().byTitle(ContentType.SPACE, "My Space")).get().getId()) .type(ContentType.PAGE) .title(pageTitle) .body(contentBody) .build(); Content page = confluence.getContentService().create(contentCreationRequest).claim(); // Upload attachment InputStream inputStream = new FileInputStream(new File(attachmentFilePath)); Upload upload = confluence.getContentService().upload(page.getId(), "attachment.png", inputStream).claim(); // Update page with attachment ContentUpdateRequest contentUpdateRequest = ContentUpdateRequest.builder() .id(page.getId()) .title(page.getTitle()) .version(page.getVersion()) .body(contentBody) .metadata(page.getMetadata()) .attachments(Arrays.asList(upload)) .build(); confluence.getContentService().update(contentUpdateRequest).claim(); } } ``` 请注意,您需要替换以下变量: - `confluence`: 您的ConfluenceApi对象。 - `pageTitle`: 您要创建的页面的标题。 - `pageContent`: 您要创建的页面的内容。 - `attachmentFilePath`:您要上传附件文件路径。 这个示例假设您已经有一个名为"My Space"的空间,您需要将其替换为您实际的空间名称。同时,您还需要进行适当的错误处理和认证,以确保您的代码可以正常运行。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

HoneyMoose

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值