因图片上传只能上传1M大小的图片,通过度娘获得更改Nginx中的限制,但是更改没有获得预期结果,继续查找可以改变MultipartFile 的限制:
修改启动类
上传代码:
工具类:
package com.steward.commons;
import com.github.tobato.fastdfs.domain.StorePath;
import com.github.tobato.fastdfs.exception.FdfsUnsupportStorePathException;
import com.github.tobato.fastdfs.service.FastFileStorageClient;
import org.apache.commons.io.FilenameUtils;
import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import org.springframework.web.multipart.MultipartFile;
import java.io.ByteArrayInputStream;
import java.io.IOException;
import java.nio.charset.Charset;
/**
*
* Description: FastDFS文件上传下载包装类
*
* Copyright: Copyright (c) 2016
*