Read and write compressed data from blob in ADF

Hi All,
I have a requirement where i need to compress/zip the file, if the file is greater than 2MB and store in database.
And i need to extract it from database in download dialog as zip file.
Please suggest me, i m using JDev 10.1.3.5 and using inputFile component or please redirect me to any examples or demos.
Regards,
R N V Prasad

Hi
I am first uploading file and if the file is more than 2MB, i am compressing it. i used the below method for compressing.
public void zipFile(String inputFilePath,String outputFilePath,String outFileName){
long fileSize;
long twoMBFileSize=2097152;
String outFileLocation;
try
byte[] data = new byte[1000];
File file=new File(inputFilePath);
FileInputStream fis=new FileInputStream(file);
BufferedInputStream in = new BufferedInputStream(fis);
fileSize = file.length();
System.out.println("File size.."+fileSize);
int count;
outFileLocation=outputFilePath+outFileName;
System.out.println("outFileLocation..."+outFileLocation);
ZipOutputStream out = new ZipOutputStream(new BufferedOutputStream(new FileOutputStream(outFileLocation)));
out.putNextEntry(new ZipEntry(outFileName));
while((count = in.read(data,0,1000)) != -1)
out.write(data, 0, count);
in.close();
out.flush();
out.close();
catch(Exception e)
e.printStackTrace();
And i will read the compressed file and posting to DB.
Here i am facing the problem while downloading the compressed files.
Naga

Similar Messages

  • How to read and write a data from extrenal file

    Hi..
    How to read and write a data from extrenal file using Pl/sql?
    Is it possible from Dyanamic Sql or any other way?
    Reagards
    Raju

    utl_file
    Re: How to Create text(dat) file.
    Message was edited by:
    jeneesh

  • How to Read and Write .XML datas   (HELP Plz...)

    hai everybody
    how to read and write xml datas... plz give clean and simple example..
    bcoz me want to produce such type of module...
    if any one help me .. thats the only way me laid in software ladder
    plz....
    thank u in advance

    thank u for giving idiot..
    but before posting i search in google also..
    but i cant get what me expect..
    thus i posted...
    then who is ................?
    sorry javacoder01
    // plz help me
    Message was edited by:
    drvijayy2k2

  • Is there a way to use the FF vi's to read and write complex data types; specifically, clusters?

    I'm trying to interface with a Fieldbus device through LabVIEW.  I need to be able to read and write a variable that consists of a cluster of two unsigned int 32's.  The FF vi's provided with FF Communications Manager 3.2 do not support clusters.  I have tried to use a code interface node to write my own, but the CIN's I was using before to do this function do not give me a device list anymore (they were originally written on Communications Manager 2.3.5).  I have recompiled the .lsb, as well as trying to use the older versions of the header and library files.  Is there another workaround I can use?

    Hello Bryan,
    The BrowseDeviceList VI was released within NI-FBUS 3.2. For NI-FBUS Configurator 3.1, please unzip the attached file and copy the "addon" and "Ff" folders into "\vi.lib" directory. LabVIEW 7.1 or above version is required for using these addons.
    And for your information, there is a free upgrade (version 3.1.1) for NI-FBUS Configurator 3.1 users. Here is the link to the upgrade kit.
    http://digital.ni.com/softlib.nsf/websearch/00A1614EC291219586256F390020671B?opendocument&node=132070_US
    Hope it helps!
    Regards,
    --Josiane
    Attachments:
    locate_fflv_in_labview82.jpg ‏214 KB
    vi.lib.zip ‏391 KB
    locate_fflv_in_labview71.jpg ‏193 KB

  • Read and average n data from text file

    I acquire numeric data from the oscilloscope [reading a waveform] that is stored in one column in a text file.
    I need to read in selectable amount of data points to average/plot them.
    So basically I wanna have a text file with millions of data points but I wanna plot say only every 1000. data point. I have tried many things I found here on the forum but as I am new to LabView, none of them really worked.
    Does anybody have a suggestion.
    Thanks.
    Solved!
    Go to Solution.

    Hi,
    among others I have tried to build the VI below but somehow I cannot get to the desired solution because according to the indicators it always stops after the first loop.
    Can you have a look please?
    Thanks.
    Attachments:
    read_and_average.vi ‏13 KB

  • How to read and write the data like this(is JSON?)?

    i have some data like below(is json?),how to write them into
    the database?
    i user coldfusion 7.
    {"title":"ColdFusion?","url":"
    http://www.adobe.com/cfusion/"},
    {"title":"flex blogs","url":"
    http://www.flexblogs.com/"},
    {"title":"studio","url":"
    http://www.sans.com.com/"}
    Thank you very much!

    You need to parse it and then insert the records into your
    database.
    Take a look at
    CFJSON it is a JSON
    serialiser and de-serialiser.
    Once you have converted it to native CF datatypes you can
    loop through it and insert it into your database.

  • Anyone have example to read and write XML to/from file

    I am writing a swing utility and need to save and read data in XML. I have looked around google, but the examples are just confusing me.
    Jonathan

    Do these xml docs have dtd's? And specific DOM implementation needs or just a custom xml?
    I have some examples in http://cvs.sourceforge.net/viewcvs.py/mathml-x/mathml-x/src/com/neuralworks/physics/Academy.java?view=markup
    follow openMenuItemActionPerformed and openFEMMLDocument(String filePath). Look for DocumentBuilder
                DocumentBuilderFactory factory =
                DocumentBuilderFactory.newInstance();
    /*            factory.setAttribute("element.factory",
                                     ELEMENT_FACTORY);
                factory.setAttribute("attribute.factory",
                                     ATTR_FACTORY);
                DocumentBuilder builder = factory.newDocumentBuilder();
                //builder.setEntityResolver(new X3DEntityResolver());
                //builder.setErrorHandler(new X3DErrorHandler());
                femDoc = findXMLFile(builder, filePath);
                org.w3c.dom.Element docElement=femDoc.getDocumentElement();
                javax.swing.tree.DefaultMutableTreeNode dmtn=new javax.swing.tree.DefaultMutableTreeNode("FEMML");
                javax.swing.tree.DefaultMutableTreeNode svgChild=new javax.swing.tree.DefaultMutableTreeNode(docElement.getNodeName());
                //System.out.println(svgDocument.getTitle()+" nv "+svgSVGElement.getNodeValue());
                //recurseDOM2TreeNodes(svgChild, docElement.getChildNodes());
                dmtn.add(svgChild);
                JTree tree=new JTree(new javax.swing.tree.DefaultTreeModel(dmtn));
                tree.setRootVisible(true);
                tree.setShowsRootHandles(true);
                tree.setEditable(true);
                //try
                    //X3DTreeAdapter x3dTreeAdapter=new X3DTreeAdapter(x3dDTDParser.parse());
                    //org.web3d.x3d.dom.swing.DOMTreeCellEditor domTreeCellEditor=new org.web3d.x3d.dom.swing.DOMTreeCellEditor();
                    //tree.setCellEditor(domTreeCellEditor);
                    //org.web3d.x3d.dom.swing.DOMTreeCellRenderer domTreeCellRenderer=new org.web3d.x3d.dom.swing.DOMTreeCellRenderer();
                    //domTreeCellRenderer.addMouseListener(x3dTreeAdapter);
                    //domTreeCellRenderer.addMouseMotionListener(x3dTreeAdapter);
                    //tree.setCellRenderer(domTreeCellRenderer);
                    //tree.addMouseListener(x3dTreeAdapter);
                    //tree.addMouseMotionListener(x3dTreeAdapter);
                    academicSplitPane.setLeftComponent(new JScrollPane(tree));Lot of commented out stuff I need to clean up. There are other examples of opening specific xml docs that have special DOM implementations; svg and mathml for example.
    For saving I use xslt with an identity transform to go from an in memory DOM source to an xml document on disk.
    Follow the saveAs(String filePath) method and the identity.xsl is http://cvs.sourceforge.net/viewcvs.py/mathml-x/mathml-x/stylesheets/identity.xsl?rev=1.2&view=markup

  • How to read and write Binary files from Forms 6i C/S ?

    Hi There,
    I have a situation, where user wants to store attachements to a record (Could be any type of file, TXT, TIFF, or Word Doc etc.) and wanted to retreive later if they wanted to edit/read.
    We are using forms 6i and Oracle 9i in client/server environment setup. Does anybody know how to solve this requirment. I'm ale to load image files with read_image_file, but it could be text some times and it could be some thing elses like word doc or excel.
    Also i have to give user an option to view existing file attachments. I'm Planing to use BLOB in database table to store files.
    Any help in this regards is appreciated

    Thanks,
    Venkat

  • How to Read and write array data into notepad or lvm?

    Hello,
    I am new to Labview and i wanted to use it in my project where i get accelerometer values X,Y and Z serially into a notepad and then displaying those values in Labview as a 3D plot or graph.The problem i am facing is the use of Cover to dynamic data express VI and how to save the array in a notepad or a lvm file.i was testing a basic block of building x and y values separately.was successful in plotting it to  graph but dont know how to save those values in a file.Can some1 please help me out in his ??
    Solved!
    Go to Solution.
    Attachments:
    Capture.PNG ‏22 KB

    Thank you for looking into this. Since I was converting into dynamic data before writing it I thought you have to convert it after reading but then I got stuck as to whether build the array again so as to display it in the graph. Dennis I did what you said and the graph on reading is a bit funny just started today and I am kinda skipping the long tutorial due to shortage of time. sorry
    Attachments:
    Capture.PNG ‏32 KB
    Capture2.PNG ‏59 KB

  • How to read and store the data from an email ?

    If there is any sample code available then it will be very helpfull
    Thanks

    You're not trying very hard.
    It's at the top of this forum:
    [http://forums.sun.com/forum.jspa?forumID=43&start=0|http://forums.sun.com/forum.jspa?forumID=43&start=0]
    It's in the documentation included with the JavaMail download.
    Oh, and have you heard of this thing called "google"?
    Try searching for "JavaMail FAQ".

  • (MHDDK) How to realize the synchronization of read and write for long time by cart PCI6025E

       I've finished the programming of the process read and write for the PCI6025E, I can read and write the data now, I wanna synchronize both of the processes, writing the data into the card just after the reading from the card, and check the wave in the oscilloscope. when I use the SEC , it works, but when I changed to MSEC, the wave only come out for a few seconds, even if I bloc 60sec, and also the wave is not steady. why?
         so now the problem is how could I write the data immediately which just read and it's for a long time I asked?
    Thanks in advance!

    Hi Jack,
    aiex4.cpp doesn't exist, as far as I can tell. I believe that while the examples were being named, the developer mis-numbered them and just skipped 4 :-S
    At any rate, if you already have AI and AO working separately, and you have the I/O performance you application requires, then you may not need to add DMA to your driver. However, if you want to add DMA, it won't be very difficult. In essence, you would need mix code from the S and M Series examples. The S Series example aiex2.cpp shows two things: the few lines of code you need to add DMA objects (lines 70-78), and how to program the STC to use DMA (line 114). And aiex3.cpp from the M Series examples gives a clearer picture of how to control and read the DMA channel.
    Thanks, Rolf, for your time and help :-) I'm grateful for your contributions, and I'm glad to see active developers in the DDK forum.
    Joe Friedchicken
    NI VirtualBench Application Software
    Get with your fellow hardware users :: [ NI's VirtualBench User Group ]
    Get with your fellow OS users :: [ NI's Linux User Group ] [ NI's OS X User Group ]
    Get with your fellow developers :: [ NI's DAQmx Base User Group ] [ NI's DDK User Group ]
    Senior Software Engineer :: Multifunction Instruments Applications Group
    Software Engineer :: Measurements RLP Group (until Mar 2014)
    Applications Engineer :: High Speed Product Group (until Sep 2008)

  • How do I read and write at the same time using the NI-CAN channel API?

    Here's the situation.  I have one CAN bus, and I need to read and write channel data (using the channel API) at the same time both at an interval of 20 ms.  It's easy to do one or the other using the channel API, but you can't setup a channel task to do both.  It's either input or output, not both.  Is this even possible?

    Hi,
    yes , this is possible. But you have to create two tasks, one for input and one for output. see the attached example for LabVIEW.
    If you download and install NI-CAN 2.4 you will get this example and one for C and VB as well.
    DirkW
    Attachments:
    Single Sample Input Output same Port.vi ‏79 KB

  • Use ODBC toread and write spatial data

    Does anyone have an example of using ODBC to read and write geometry objects from and to Oracle9i with Oracle Spatial?

    hi ,
    you cannot read geometry with odbc you have to use oo4o(oracle object for ole)
    here a sample code :
    Private Sub mnu_test_Click()
    Dim OraSession As OraSession
    Dim OraDatabase As OraDatabase
    Dim LRS As OraDynaset
    Dim Ordinates As OraCollection
    Dim sdo_geometry As OraObject
    Dim i As Integer
    Set OraSession = CreateObject("OracleInProcServer.XOraSession")
    Set OraDatabase = OraSession.DbOpenDatabase("n12dev6", "gis/spatial", ORADB_DEFAULT)
    Set LRS = OraDatabase.CreateDynaset("select * from GPS_LRS where id ='11SR012001'", ORADB_DEFAULT)
    Set sdo_geometry = LRS.Fields("geometry").Value
    Set Ordinates = sdo_geometry.Item("sdo_ordinates").Value
    'access all elements of the SDO_ORDINATES VArray
    For i = 1 To Ordinates.Size
    MsgBox Ordinates(i)
    Next i
    End Sub
    hope this helps
    vikesh

  • Read and write excel sheet data from uploded file in sharepoint site programmatically 2013

    hi team,
    I am working on sharepoint 2013.I want to read and write data in excel sheet (micrsoft excel) from stored file in shrepoint docoumnt library .please suggest me
    vijay

    Hi
    Vijay,
    check those links
    http://www.sharepointwithattitude.com/archives/61
    https://social.technet.microsoft.com/Forums/en-US/e760051b-a92f-473c-9ec9-0f0c36c99e40/read-and-write-excel-sheet-data-from-uploded-file-in-sharepoint-site-programmatically-2013?forum=sharepointdevelopment
    Kind Regards, John Naguib Technical Consultant/Architect MCITP, MCPD, MCTS, MCT, TOGAF 9 Foundation. Please remember to mark the reply as answer if it helps.

  • How to read and write data from json file from windows phone7 app

    Hi
    I am developing wp7 app for the use of students my questions are
    How can i write a code to read and write the json/text file for the wp7.
    I am using windows 7 OS, VS 2010 Edition.
    This is my code below:
    xaml:
    <Grid>
                        <TextBlock Height="45" HorizontalAlignment="Left" Margin="7,18,0,550" Name="textBlock1" Text="Full
    Name: " />
                        <TextBox Width="350" Height="70" HorizontalAlignment="Left" Margin="108,1,0,0" Name="txtName"
    Text="Enter your full name" VerticalAlignment="Top" />
                        <TextBlock Height="45" HorizontalAlignment="Left" Margin="6,75,0,0" Name="textBlock2" Text="Contact
    No: " VerticalAlignment="Top" />
                        <TextBox Width="350" Height="70" HorizontalAlignment="Left" Margin="108,61,0,480" Name="txtContact"
    Text="Enter your contact number" MaxLength="10" />
                        <Button Content="Register" Height="72" HorizontalAlignment="Left" Margin="10,330,0,0" Name="btnRegister"
    VerticalAlignment="Top" Width="190" Click="btnRegister_Click" />
                    </Grid>
    xaml.cs:
    private void btnRegister_Click(object sender, RoutedEventArgs e)
                string name, contact;
                name = txtName.Text;
                contact = txtContact.Text;
                try
                    if (name != "" && contact != "")
                        string msg = name + " " + contact;
                        MessageBox.Show(msg);
                        Student stud = new Student
                            Name= name,
                            Contact = contact,
                        string jsonString = JsonConvert.SerializeObject(stud);
                        MessageBox.Show(jsonString);
                    else
                        MessageBox.Show("Input Proper Information", MessageBoxButton.OK);
                catch (Exception ex)
                    MessageBox.Show(ex.Message);
    I have download NewtonSoft.json version 5.0.8.
    So, I am able to convert input data into json format, but how can I able to write and read this data from a json/text file.
    How can I do?
    Thank you in adv and please, reply soon.

    We don't have many samples left for Windows Phone 7 + Azure, the closest one to what you want to do is probably:
    Using Local Storage with OData on Windows Phone To Reduce Network Bandwidth
    this sample uses the local database feature: 'LINQ to SQL', available to Windows Phone 7.1 and 8.0 Silverlight applications, instead of simple file storage but even if you choose to stick with simple file storage I believe you should be able to adapt the
    networking related portions of the sample to your particular application.
    Eric Fleck, Windows Store and Windows Phone Developer Support. If you would like to provide feedback or suggestions for future improvements to the Windows Phone SDK please go to http://wpdev.uservoice.com/ where you can post your suggestions and/or cast
    your votes for existing suggestions.

Maybe you are looking for

  • Split a ZIP File in smaller Chunks / payloads on ECC 6.0 (NOT PI)

    I call a external web service directly from ECC6.0.  In one of the proxy class's methods I need to send a zip file. I can generate ZIP file using SAP supplied class. The file size of this zip file 150 MB and I want to break this file in smaller chunk

  • Help recovering a locked file!!

    I massively messed up yesterday with my InDesign CS3 files. I connected my Macbook to the server at work and I was working on multiple IDD documents from the network in this book. I left for the day without saving and closing all IDD windows. So when

  • NONE OF THESE SCRATCHES ARE COMING OFF!!!! I USED BOTH BRASSO AND ICLEANER!

    Man i am sick and tired of this. NOne of these scratches are coming off. Iused icleaner which i wasted 35 dollars on and brasso which i found stored in our closet, thank god i didnt need to spend money for that. I may as well give up on this ipod, th

  • Automatically optimize for battery lifespan charges the batt to 100% in Power Manager settings

    Whats crazy about my system is I did a complete driver update with the lenovo update and I still dont have the option for Automatically optimize for battery lifespan. It never shows in my options please someone help me to get this option so I wont bu

  • Going from Dual boot to total Mac OS Question

    I'm reformatting my Dual boot system to a total mac OS. Should I install my music programs on my main Mac HD, ( I already have mainly art programs on my Mac HD), Or, should I install them on the reformatted HD? Logic Pro 9 is already installed on my