Details | Last modification | View Log | RSS feed
| Rev | Author | Line No. | Line |
|---|---|---|---|
| 555 | blopes | 1 | package br.com.ec.controller.util; |
| 2 | |||
| 3 | import java.io.FileOutputStream; |
||
| 4 | |||
| 5 | import javax.servlet.ServletContext; |
||
| 6 | |||
| 7 | public class FileUtil { |
||
| 8 | |||
| 9 | public static void uploadArquivo(ServletContext servletContext, String caminhoArquivo, byte[] arquivo) { |
||
| 10 | try { |
||
| 11 | FileOutputStream fos = new FileOutputStream(servletContext.getRealPath("/") + "/" + caminhoArquivo); |
||
| 12 | fos.write(arquivo); |
||
| 13 | fos.flush(); |
||
| 14 | fos.close(); |
||
| 15 | } catch (Exception e) { |
||
| 16 | e.printStackTrace(); |
||
| 17 | } |
||
| 18 | } |
||
| 19 | |||
| 20 | } |