Revision history [back]

click to hide/show revision 1
initial version

answered 2012-02-06 19:49:24 +0800

alexandrecoelho gravatar image alexandrecoelho

Hi, thanks!!

The upload it´s working, but when i create a file with the uploaded media, the size of file is 0KB. That just happened with files less than 17KB.

The part of code is:

        Media media = ((UploadEvent)event).getMedia();

        String path = Executions.getCurrent().getDesktop().getWebApp().getRealPath("/arquivos") + "\\"; 

        try {

              if (media.isBinary()) {
                File dest = new File(path + media.getName());
                Files.copy(dest, media.getStreamData());
            }
            else {
                BufferedWriter writer = new BufferedWriter(new FileWriter(path + media.getName()));
                Files.copy(writer, media.getReaderData());
            }

        } catch (IOException e) {
            e.printStackTrace();
        }
Support Options
  • Email Support
  • Training
  • Consulting
  • Outsourcing
Learn More