liuxiaolong
2019-05-06 71af9c46c24b562acc00a71ec6c97c04eb048d9c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
package com.cloud.device.utils;
 
//import org.csource.fastdfs.*;
 
import java.util.Date;
 
//public class FastDFSUtil {
//    //fdfs_client 核心配置文件
//    public static String conf_filename="fdfs_client.conf";
//
//
//    public static String  uploadByByte(byte[] bytes,String extName) {    //上传文件
//        TrackerServer trackerServer =null;
//        StorageServer storageServer = null;
//        try {
//            ClientGlobal.init(conf_filename);
//            TrackerClient tracker = new TrackerClient();
//            trackerServer = tracker.getConnection();
//            StorageClient1 client = new StorageClient1(trackerServer, storageServer);
//
//            StorageClient storageClient = new StorageClient(trackerServer, storageServer);
//            String fileIds[] = storageClient.upload_file(bytes, extName, null);
//            //获取文件信息,并保存至数据库
//            return fileIds[0]+"/"+fileIds[1];
//        } catch (Exception e) {
//            e.printStackTrace();
//            return null;
//        }
//    }
//}