Here you can find the source of writeFile(byte[] content, String filename)
public static void writeFile(byte[] content, String filename) throws IOException
//package com.java2s; //License from project: Open Source License import java.io.File; import java.io.FileOutputStream; import java.io.IOException; public class Main { private static String SERVER_PATH = "C:\\Java\\web\\uploadFile\\"; public static void writeFile(byte[] content, String filename) throws IOException { File file = new File(SERVER_PATH + filename); if (!file.exists()) { file.createNewFile();/* w w w. j ava 2 s .co m*/ } FileOutputStream fop = new FileOutputStream(file); fop.write(content); fop.flush(); fop.close(); } }