FastDFS图片上传工具类
public class UploadUtil { public static String uploadImage ( MultipartFile multipartFile ) { String imgUrl = Constant . trackerServerIP ; //fastdfs服务器ip自行设置 //上传图片服务器 //配置fdfs的全局链接地址 String tracker = PmsUploadUtil . class . getResource ( "/tracker.conf" ) . getPath ( ) ; //获得配置文件的路径 try { ClientGlobal . init ( tracker ) ; } catch ( IOException e ) { e . printStackTrace ( ) ; } catch ( MyException e ) { e . printStackTrace ( ) ; } TrackerClient trackerClient = new TrackerClient ( ) ; //获得trackerServer的实例 TrackerServer trackerServer = null ; try { trackerServer = trackerClient . getConnection (