Escolar Documentos
Profissional Documentos
Cultura Documentos
Untitled
Untitled
"); // concatenar extensao String nomeReal = System.currentTimeMillis() + "." + ext[1]; String nomeArquivo = form.getFileUpload().getFileName(); try { String caminhoParaSalvar = AnexosUtil.getUploadFileFolde r(); FormFile item = form.getFileUpload(); // pegando o nome do arquivo que foi feito o upload if (item.getFileName() != null) { byte[] bytes; bytes = item.getFileData(); File file = new File(caminhoParaSalvar, nomeReal ); DataOutputStream out = new DataOutputStream(new FileOutputStream(file)); out.write(bytes); out.close(); } System.out.println("Arquivo " + item.getFileName() + " f oi salvo"); menssagem.append("nomeArquivo:'" + nomeArquivo); menssagem.append("',nomeArquivoReal:'" + nomeReal); menssagem.append("'}"); response.getWriter().print(menssagem.toString()); } catch (Exception e) { System.out.println("Arquivo N O foi salvo - UploadAction.ja va"); e.printStackTrace(); } return null;