Hitachi Vantara Pentaho Community Forums
Results 1 to 5 of 5

Thread: BLOB to file

  1. #1

    Default BLOB to file

    Hi,
    I found the sample
    Code:
    General - Load images and store into database table.ktr
    and it works great,
    but I need the other way round.

    I found the way to write the file with a 'text file output'-step but there is alway a 'new line' at the end. That's OK for XML but not for binary data.

    So can anybody help me to extract BLOBs into files.
    I guess it must be in a Javascript-step like the sample but my Java is so pur...

    thanks in advance!

  2. #2

    Default

    It's an old link:

    http://wiki.pentaho.com/display/COM/...ts+With+Kettle

    hope it helps

    Stefano Bonnin
    Comai Torino Srl
    http://www.comai.to

  3. #3

    Default

    ooops sorry it's your example...

    sorry again


  4. #4
    Join Date
    Nov 1999
    Posts
    9,729

    Default

    Something like this:

    Code:
    var tmpFile = new Packages.java.io.File(filename.getString());  
    var file = new Packages.java.io.File("/tmp/"/+tmpFile.getName());  
    var fileOutputStream = new Packages.java.io.FileOutputStream(file);
    fileOutputStream.write(content.getBytes(), 0, content.getBytes().length);
    fileOutputStream.close();

  5. #5

    Default

    Cool! Sometimes things can be so easy!
    Thanks a lot!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Privacy Policy | Legal Notices | Safe Harbor Privacy Policy

Copyright © 2005 - 2019 Hitachi Vantara Corporation. All Rights Reserved.