How to File Convert to Blob? help me

Hey Guys...........
How to convert inputStream to blob ????
kit = new RTFEditorKit();
Document doc = kit.createDefaultDocument();
InputStream is = getUploadedFile().getInputStream();
DCIteratorBinding iterTemplate = ADFUtils.findIterator("TemplateVOIterator");
Row currentRow = iterTemplate.getCurrentRow();
String templateId = currentRow.getAttribute("Id").toString();
currentRow.setAttribute("TemplateFile", ????); in here Blob file....
"is" convert to blob ???
Regards Ninja,
Edited by: Ninja on Jul 21, 2011 7:04 PM
Edited by: Ninja on Jul 21, 2011 11:39 PM

Timo Hahn wrote:
Well, it's all in the sample Frank pointed you to:
//your code
kit = new RTFEditorKit();
Document doc = kit.createDefaultDocument();
InputStream is = getUploadedFile().getInputStream();
DCIteratorBinding iterTemplate = ADFUtils.findIterator("TemplateVOIterator");
Row currentRow = iterTemplate.getCurrentRow();
String templateId = currentRow.getAttribute("Id").toString();
currentRow.setAttribute("TemplateFile", newBlobDomainForInputStream(is)); in here Blob file....
private BlobDomain newBlobDomainForInputStream(InputStream in) throws SQLException, IOException {
BlobDomain b = new BlobDomain();
OutputStream out = b.getBinaryOutputStream();
writeInputStreamToOutputStream(in,out);
in.close();
out.close();
return b;
private static void writeInputStreamToOutputStream(InputStream in, OutputStream out) throws IOException {
byte[] buffer = new byte[8192];
int bytesRead = 0;
while ((bytesRead = in.read(buffer, 0, 8192)) != -1) {
out.write(buffer, 0, bytesRead);
}TimoI can new method..... This is GOOD..
*> kit = new RTFEditorKit();*
*> Document doc = kit.createDefaultDocument();*
*> InputStream is = getUploadedFile().getInputStream();*
byte[] bytes = IOUtils.toByteArray(is);
Blob blob = new SerialBlob(bytes);
currentRow.setAttribute("TemplateFile", blob);
like
Edited by: Ninja on Jul 28, 2011 10:59 PM

Similar Messages

  • Unable to Edit DOCx file converted by ExportPDF - HELP!

    I am unable to edit a DOCx file that I created by converting a PDF file using the ExportPDF subscription.
    The file was originally created in Adobe InDesign.  I have the PDF.  I need to convert it to DOCx to edit the text.  The document is basically text and a few photos. I don't care about the photos.
    When I convert the PDF using ExportPDF I get a DOCx file but I am not able to edit the text.  It appears to have converted it into graphics.  I tried to highlight the 'boxes' hoping to use the Word 'convert tables to text' feature, but that does not seem to work here.
    I tested ExportPDF with another PDF that was created from a text-only DOCx file.  ExportPDF converted it seamlessly to a  DOCx file.
    How can I convert a PDF file, originally created in Adobe InDesign, to a DOCx file in which I can edit the text. 
    Thanks.

    Dannie,
    Are you familiar with dreamweaver templates and editable regions? If the logo is in the template, then you need to modify the template file. The changes you make to the template will automatically be propogated to all of the files which use the template.  If your html file uses a template, the html code will look like its commented out.
    Also, you should not have to download the html fiile from your server because you should always keep a copy of all the html files on your computer.
    I don't know about the SWF error.
    Good luck.
    mitzy_kitty

  • How .java file converted into .class file

    Hi,
    Please tell me the process which is happening behind when actually we complile a java programm.
    How it is called by class loader.and then what happen

    The compiler lexes and parses the Java source, probably creates an AST, optimizes it, generates byte code, writes byte code to file. For details on compilation, get a book on compilers (Aho, Sethi, Ullman "Compilers: Principles, Techniques and Tools", aka The Dragon Book, is the classic, though there are more modern ones.)
    For class loading, google for java class loader. Here are some basics:
    http://java.sun.com/j2se/1.3/docs/api/java/lang/ClassLoader.html
    http://www.javaworld.com/javaworld/jw-10-1996/jw-10-indepth.html
    http://www.developer.com/java/other/article.php/888911

  • How to load externl files (PDF) into BLOB column.  Please help.

    Hi All,
    I've currently been working on loading many external binary files (PDF) into BLOB column. After some digging, I learn that the SQL*LOADER can be used to load data from external files into table. I also got help from another forummate mentioning to use PL/SQL procedure to do so. Since I have not done anything like this before. So, my question is what is the simple approach needed to upload PDF files into a table(there is only one table containing BLOB column in my database). In addition, the LOBs can not be query-able, I wanted to list the contents of the LOBs column to make sure that I did successfully upload data into the database. How can I do that?. I do need your help. Please direct me step by step how to do so. Your help is greatly appreciated.
    Regards,
    Trang

    Hi,
    If the following link helps to you then great.
    http://www.exefind.com/oralobeditor-P25468.html
    Regards,
    Sailaja

  • How could I convert a locked PDF file to Microsoft Word file?Uergency for exam!Need help!

    How could I convert a locked PDF file to Microsoft Word file? Because of locking, I could not print it. Uergency for examination! Need help from veteran!

    Adobe do not offer any products, or help, in hacking protected files.

  • Need help!: How to covert Excel into BLOB and pass into procedure?

    Hi,
    I am writing a program in which I am uploading file from front-end and passing that file into Oracle procedure in BLOB format.
    Can someone help me ,that **how to convert Excel sheet into BLOB and then how we can pass that BLOB object to procedure in oracle*.
    Any help will greatly appreciated.
    Thanks

    Guys,
    I am able to convert FormFile into byutes using getFileData();
    But when I am tryint oconvert into BLOB,it is dhoowing me the error.
    Please find the complete details below.
    I am trying to Upload one file using FormFile of Struts and I need to pass that Form File into one procedure having BLOB as aIn parameter. SO I need to convert that file into BLOB object
    The code that I am trying is :
    try{
    BLOB blob= BLOB.getEmptyBLOB();
    System.out.println("before");
    blob.setBytes(theFile.getFileData());
    System.out.println("after");
    cs.setBlob(3, blob);
    }catch(Exception e){System.out.println("in the BLOB "+e);}
    After running the code,I am getting the following error
    java.lang.ArrayIndexOutOfBoundsException
    at java.lang.System.arraycopy(Native Method)
    at oracle.jdbc.driver.DatumBinder.bind(OraclePreparedStatement.java:15839)
    at oracle.jdbc.driver.OraclePreparedStatement.setupBindBuffers(OraclePreparedStatement.java:2865)
    at oracle.jdbc.driver.OraclePreparedStatement.processCompletedBindRow(OraclePreparedStatement.java:2150)
    at oracle.jdbc.driver.OraclePreparedStatement.executeInternal(OraclePreparedStatement.java:3279)
    at oracle.jdbc.driver.OraclePreparedStatement.execute(OraclePreparedStatement.java:3389)
    at oracle.jdbc.driver.OracleCallableStatement.execute(OracleCallableStatement.java:4222)
    at dms.bo.impl.LoadManagement.UploadMetadataDAOImpl$1.doInCallableStatement(UploadMetadataDAOImpl.java:38)
    at org.springframework.jdbc.core.JdbcTemplate.execute(JdbcTemplate.java:953)
    at dms.bo.impl.LoadManagement.UploadMetadataDAOImpl.getBlobString(UploadMetadataDAOImpl.java:28)
    at dms.web.action.LoadManagement.UploadMetadataAction.perform(UploadMetadataAction.java:33)
    at dms.web.action.common.BaseAction.execute(BaseAction.java:17)
    at org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:419)
    at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:224)
    at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1194)
    at org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:432)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:710)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:269)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188)
    at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
    at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:174)
    at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
    at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:117)
    at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:108)
    at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:174)
    at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:874)
    at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:665)
    at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:528)
    at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:81)
    at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:689)
    at java.lang.Thread.run(Thread.java:619
    So with

  • How can i convert video files from my mac to watch them on my iphone?, how can i convert video files to watch them on my iphone?

    how can i convert video files from my mac to watch them on my iphone?, how can i convert video files to watch them on my iphone?

    Turns out the answer to that question changes if you ask it more than 4 times, so ask it again....
    The answer depends on the type of video files you want to convert.  If they are DRM protected commercial videos, no help can be given here.  Google.

  • How can I convert an odg. file to a pdf. file?

    Hello, how can I convert an odg. file to a pdf. file?
    When choosing Drawing as template in OpenOffice, it saves projekt as odg. which apparently gives difficulties compared to pdf.

    Try this: http://www.convertfiles.com/convert/document/ODG-to-PDF.html
    Let me know if it helps,
    Kevin

  • How can I convert the ringtone (m4r file) I made into an mp3 file on itunes?

    How can I convert the ringtone (m4r file) that I made into an mp3 file on iTunes? I want to put it on a CD, but I can't figure out how to convert it. I didn't buy it, I made it by converting a YouTube video into an mp3 (I wanted to get the little song in the video for a ringtone.) I'm not sure what to do. 

    Hello ed2345,
    Thanks for the help, but this is not the problem.
    It's hard to describe the problem, but I'll try it again, this time with pictures.
    I was left with the following folders in the iTunes Downloads folder.
    http://www.picfront.org/d/7yb3
    These TMP Folders have a download.m4a and a Info.plist file.
    After moving the audio files in iTunes a bit I get this.
    http://www.picfront.org/d/7yb2
    As you can see no other Information for the download.m4a than the length.
    That's how the .m4p file looks like
    http://www.picfront.org/d/7yb1
    And this is how the same .m4a file currently looks
    http://www.picfront.org/d/7yb0
    Like I said, I could edit all these download.m4a files by myself but that would leave some information out.
    Note: Sorry, I hope the links do not spam you with annoying ads. I don't get any but I was told that there can be some annoying one.

  • How do I convert an sdw. file to microsoft word?

    I wrote a book on an older star office program about 7 yrs ago and I need to convert the sdw. file somehow so I can transfer the book into microsoft word. I do not have the star office program any longer. Please help??!!

    I recently purchased a new computer with Microsoft word 2007 installed . How can I convert starOffice files to Microsoft Word Files?
    Thanks, Bertz9

  • How can i convert a file in flash

    how can i convert a .fla file into swf, mp4 or avi files so i can actually display them?
    i made some nice animations but can't share them because i can't save them in my wished format.

    HI
    GOOD
    I NEVER FACED SUCH KIND OF ISSUES, BUT HERE I AM GIVING SOME DETAILS ABOUT SAP RDI FORMAT,I HOPE THIS WILL HELP YOU TO SOLVE YOUR PROBLEM.
    Description
    Using the SAPscript Raw Data Interface (RDI), you can connect external text management systems to control individual requests, for example, optimizing postage expense. The interface contains all form data from the R/3 System, but no layout information such as font or page size. The external system alone is responsible for the layout and administration of the document data. The RDI is of special importance for mail processing. The external system sorts the document data from the interface and forwards the documents accordingly.
    The Raw Data Interface is a certified interface and allows easy connection to external systems. However, you pay the price for this extra function, as you lose tight integration with the R/3 System. For example, you cannot find out from within an R/3 application whether the external system successfully printed and sent the documents. In addition, extra expense is incurred each time you adapt a standard form, since the system has to adapt both an internal and external form. The external tool is not an integral part of the ABAP Development Workbench, so that field information (field type, output length and so on) from the ABAP Dictionary is not available.
    THANKS
    MRUTYUN

  • How do I convert the MP4 files in itunes back to MP3 files so they can be downloaded on a usb drive to play on a CD player?

    I am not a computer genius.  Somehow, my Itunes files are now in MP4 format.  How do I convert the whole library back to MP3 so I can download on a usb drive to play on the CD player?  Help!!!

    iTunes: How to convert a song to a different file format - http://support.apple.com/kb/HT1550 - including information about different formats and discussion about compression.
    In iTunes11: File > Create New Version

  • How can I convert my Open Source document files into Word document files? I cannot download Pages since my Macbook Air does not have the most recent software.

    How can I convert my Open Source document files into Word document files? I cannot download Pages since my Macbook Air does not have the most recent software. I downloaded open office to my mac to try and save money. It worked well for a while. Now I get this pop-up message that asks me to "Reopen" and when I select the option, nothing happens. I cannot save my documents anymore and I cannot convert them to word. Help!

    dwb wrote:
    Does OpenOffice output Word documents by default or do you have to select it manually?
    You have 17 options to save as in Open Office, one of which is .doc  files,  yes it needs to be saved manually.
    You may be able to default to DOC, but have not tried same.
    Since Open Office is 99% same as Word, I use it, or Word, either one.  Open Office is a bit less buggy than Word 11'

  • How can I convert the volume directory into a single file installer?

    How can I convert the volume directory into a single file installer? I would like to hide all the miscillaneous files that I don't care for and be able to have the installer double click a single file and have it automatically install.

    On the second prompt screen when prompted 'What kind of self-extracting Zip file file do you want to make?'
    Are you choosing the second option (self-extracting Zip file for software installation)?
    I have a word file that I created to help me remember - is there anyway to email it to you?

  • How can I convert datalog files from LV5.0 to LV6i?

    I have some datalog files from LV5.0 and I'd like to use them in LV6i, but when although I push convert when asked in the moment of reading the file,it provides input parameter invalid when reading. I'm using the same vi I used to create and read them in LV5, so it's not supposed to be a program mistake. How can I convert them?"

    Hello,
    Thanks for answering my question. I downloaded LV6.02 as you suggested but the problem persists.
    I don't know maybe it's something very simple. I have attached 1 program to read the datalog file and another one that reads it in every version (LV5.0 and LV6.02) in case you can help me.
    Thanks again,
    Javi
    Attachments:
    WriteLV5.vi ‏65 KB
    OpenLV5.vi ‏74 KB
    OpenLV6.vi ‏59 KB

Maybe you are looking for