1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
| package com.whyc.util;
|
| import java.io.File;
| import java.io.FileOutputStream;
| import java.io.IOException;
|
| public class FileUtils {
|
| public static void uploadFile(byte[] file, String filePath, String fileName) throws IOException {
|
| File targetFile = new File(filePath);
| if (!targetFile.exists()) {
| targetFile.mkdirs();
| }
| FileOutputStream out = new FileOutputStream(filePath + fileName);
| out.write(file);
| out.flush();
| out.close();
| }
| }
|
|