OSS-S3上传文件失败

Blade 未结 2 48
gtfhao
gtfhao 11小时前

一、该问题的重现步骤是什么?

1. 点击调试

2. 上传文件

3.接口500,


二、你期待的结果是什么?实际看到的又是什么?

期待正常上传

实际拨错


三、你正在使用的是什么产品,什么版本?在什么操作系统上?

商业版最新版

四、请提供详细的错误堆栈信息,这很重要。

  1. "Failed to reset the input stream;  If the request involves an input stream, the maximum stream buffer size can be configured via request.getRequestClientOptions().setReadLimit(int)"

五、若有更多详细信息,请在下面提供。

image.png


2条回答
  •  gtfhao
    gtfhao (楼主)
    9小时前

    连的是rustfs,它自带的管理工具传图片都没问题,我修改了一下这个地方可以传了,但是后台会有警告报出来:

    @SneakyThrows
    @PostMapping("/put-file")
    public R<BladeFile> putFile(@RequestParam MultipartFile file) {
       File tempFile = File.createTempFile("upload", file.getOriginalFilename());
       file.transferTo(tempFile);

       BladeFile bladeFile = ossBuilder.template().putFile(file.getOriginalFilename(), new FileInputStream(tempFile));
       return R.data(bladeFile);
    }

    warn日志:c.amazonaws.services.s3.AmazonS3Client   : No content length specified for stream data.  Stream contents will be buffered in memory and could result in out of memory errors.

    image.png

    作者追问:9小时前

    rustfs我们下版本兼容下

    作者追问:9小时前

    这个warn日志意思是上传的时候没有告知内容长度,不影响使用

提交回复