<dependency>
<groupId>com.github.tobato</groupId>
<artifactId>fastdfs-client</artifactId>
<version>1.27.2</version>
</dependency>
Controller类下:
import com.github.tobato.fastdfs.domain.fdfs.MetaData;
import com.github.tobato.fastdfs.domain.fdfs.StorePath;
import com.github.tobato.fastdfs.domain.fdfs.ThumbImageConfig;
@Autowired
private FastFileStorageClient storageClient;
@Autowired
private ThumbImageConfig thumbImageConfig;
/**
*
* @param pathname 文件上传本地路径
* @return
* @throws Exception
*/
@RequestMapping("/upload_thumbImage")
public Map<String,Object> upload_thumbImage(String pathname) throws Exception{
//上传图片的缩略图----默认保存是jpg
File file=new File(pathname);
StorePath storePath = this.storageClient.uploadImageAndCrtThumbI