.z multipart files

Can anyone enlighten me as to how to uncompress a folder of files I've been sent.
There are 4 files ending in suffixes .z01, .z02, .z03 and .zip.
I presume they are a multipart archive, and I seem to have found out they have unix compression.
I have tried Stuffit Expander, Compress, Untar, GUI Tar, OpenUp, and a couple of others version tracker recommended. I'm getting nowhere.
Can anyone help?

Just guessing, but I wonder if you can just con'cat'enate them together... eg. using "/Applications" > "Utilities" > "Terminal.app":<pre>cd /path/to/enclosingfolder
cat file.zip file.z01 file.z02 file.z03 > rejoined.zip</pre>

Similar Messages

  • J2me multipart file upload-  Help Needed

    package com.mpbx;
    import javax.microedition.midlet.*;
    import javax.microedition.lcdui.*;
    import javax.microedition.io.*;
    import java.io.*;
    public class PostFile extends MIDlet implements Runnable, CommandListener{
        private final String FILE = "/image.jpg";
        private final String URL = "http://localhost/post.php"; // change this to a valit page.
        private final String CrLf = "\r\n";
        private Form form = null;
        private Gauge gauge = null;
        private Command exitCommand;
        private Command uploadCommand;
        public PostFile(){
            form = new Form("Upload File");
            gauge = new Gauge("Progress:", true, 100, 0);
            form.append(gauge);
            exitCommand = new Command("Exit", Command.EXIT, 0);
            uploadCommand = new Command("Upload", Command.SCREEN, 0);
            form.addCommand(exitCommand);
            form.addCommand(uploadCommand);
            form.setCommandListener(this);
        public void startApp() {
            Display.getDisplay(this).setCurrent(form);
        public void pauseApp() {
        public void destroyApp(boolean unconditional) {
        private void progress(int total, int current){
            int percent = (int) (100 * ((float)current/(float)total));
            gauge.setValue(percent);
        public void run() {
            httpConn();
        private void httpConn(){
            HttpConnection conn = null;
            OutputStream os = null;
            InputStream is = null;
            try{
                System.out.println("url:" + URL);
                conn = (HttpConnection)Connector.open(URL);
                conn.setRequestMethod(HttpConnection.POST);
                String postData = "";
                InputStream imgIs = getClass().getResourceAsStream(FILE);
            byte []imgData = new byte[imgIs.available()];
               imgIs.read(imgData);
                String message1 = "";
                message1 += "-----------------------------4664151417711" + CrLf;
                message1 += "Content-Disposition: form-data; name=\"uploadedfile\"; filename=\"" + FILE + "\"" + CrLf;
                message1 += "Content-Type: image/jpeg" + CrLf;
                message1 += CrLf;
                // the image is sent between the messages ni the multipart message.
                String message2 = "";
                message2 += CrLf + "-----------------------------4664151417711--" + CrLf;              
                conn.setRequestProperty("Content-Type", "multipart/form-data; boundary=---------------------------4664151417711");
                // might not need to specify the content-length when sending chunked data.
                // conn.setRequestProperty("Content-Length", String.valueOf((message1.length() + message2.length() + imgData.length)));
                System.out.println("open os");
                os = conn.openOutputStream();
                System.out.println(message1);
                os.write(message1.getBytes());
                // SEND THE IMAGE
                int index = 0;
                int size = 1024;
                do{
                    System.out.println("write:" + index);
                    if((index+size)>imgData.length){
                        size = imgData.length - index;
                    os.write(imgData, index, size);
                    index+=size;
                    progress(imgData.length, index); // update the progress bar.
                }while(index<imgData.length);
                System.out.println("written:" + index);           
                System.out.println(message2);
                os.write(message2.getBytes());
                os.flush();
                System.out.println("open is");
                is = conn.openInputStream();
                char buff = 512;
                int len;
                byte []data = new byte[buff];
                do{
                    System.out.println("READ");
                    len = is.read(data);
                    if(len > 0){
                        System.out.println(new String(data, 0, len));
                }while(len>0);
                System.out.println("DONE");
            }catch(Exception e){
                e.printStackTrace();
            }finally{
                System.out.println("Close connection");
                try{
                    os.close();
                }catch(Exception e){}
                try{
                    is.close();
                }catch(Exception e){}
                try{
                    conn.close();           
                }catch(Exception e){}
        public void commandAction(javax.microedition.lcdui.Command command, javax.microedition.lcdui.Displayable displayable) {
            if(command == exitCommand){
                this.notifyDestroyed();
            }else if(command == uploadCommand){
                new Thread(this).start();
    }Running this yields the error below...Can someone suggest me. whats the problem.
    url:http://localhost/post.php
    java.lang.NullPointerException
            at com.mpbx.PostFile.httpConn(PostFile.java:85)
            at com.mpbx.PostFile.run(PostFile.java:68)
    Close connection

    I also faced the same problem. To make this code work you will have to include the image.jpg in the jar. To do that, copy the image file in the src directory inside your project folder (if you are using netbeans) and then build the project.
    Remember, the web server should be running in background.

  • Reliable file upload using JDev, AS and other

    Hello,
    I'm not sure this is the right place to post this message, sorry if I was wrong to put it here.
    The question is our company is developing software, for active data exchange with other systems. We decided to exchange in xml format, by means of both web services and web interface (so that exchange could happen both automatically and on user request). We use JDev to develop, Oracle AS to deploy application. Systems we exchange can use various platforms, in fact, it doesn't matter what exactly they use. The question is we need a reliable way to exchange large (sometimes small, but can be 1Gb or, for example, 10Gb) files, maybe with appropriate security, so that it could continue if something happens with network connection.
    One simple decision is to have a web service that accepts, for example, 100K at a time, and another service continuously calls it until file is transfered. So it can check response code. But are there better decisions? I think, there are libraries or smth like this?
    Thanks in advance, believe, it's a right place to get help.
    Valeriy

    Another, simpler (we think), such package is Jenkov HTTP Multipart File Upload. It's a servlet filter which can work in front of both servlets and JSP's. The servlet filter parses the uploaded file and stores it temporarily on the servers disk. When the servlet or JSP executes afterwards, it can obtain all the information about the file, from the request attributes. There is a decent manual for HTTP Multipart File Upload on the website.
    Just search for "Jenkov HTTP Multipart" on Google and you'll find it. HTTP Multipart is free, open source, Apache Licsense.

  • File upload and download using jsp/servlets

    How to upload any file to the server using jsp/servlets. . Help me out

    You can also try the Jenkov HTTP Multipart File Upload. It's a servlet filter that is easy to add to your web-project. After adding it, you can access both request parameters and the uploaded files easily. It's more transparent than Apache Commons File Upload. There is sufficient documentation to get you started, and there is a forum if you have any questions.
    Jenkov HTTP Multipart File Upload is available under the Apache license, meaning its free to use.

  • File upload and download using secure connection ??

    hi,
    i have to transfer file from clinet machine to server.
    so, actually my need is, client submit form , then that file will go to url like "www.abc.com/ " server receives and store data in database and after that sends new file to that client
    but all this transfer must be on secure way.
    i have to done that in java only (not in jsp) and this concepts are new for me
    so, how can i transfer that file ?
    pls, help me......

    You can also try the Jenkov HTTP Multipart File Upload. It's a servlet filter that is easy to add to your web-project. After adding it, you can access both request parameters and the uploaded files easily. It's more transparent than Apache Commons File Upload. There is sufficient documentation to get you started, and there is a forum if you have any questions.
    Jenkov HTTP Multipart File Upload is available under the Apache license, meaning its free to use.

  • Unable to create file using java.io.File

    I have attached my code
    public boolean validateZip(MultipartFile file, List<String> files) throws Exception {
              String fileName = file.getOriginalFilename();
              File tempFile = new File("C://workspace//tempData//" + fileName);
              LOG.info("Absolute path : " + tempFile.getAbsolutePath());
              ZipFile zipFile = new ZipFile(tempFile);
              LOG.info("No of enteries in the zip : " + zipFile.size());
              //loop through the list and check if the entry is in the zip file
         }The problem is, no exception is thrown in
    ' File tempFile = new File("C://workspace//tempData//" + fileName);
    but, a FileNotFoundException is thrown in
      ZipFile zipFile = new ZipFile(tempFile);Also, it specifies the Absolute Path, but when I check there, there is no file created.
    Any help is appreciated.
    TIA

    ok, when I debug my application for the following code :
    String dir = "C:\workspace";
    String fileName = file.getOriginalFilename();   // file is an instance of a multipart file
    File tempFile = new File(dir, fileName);
    ZipFile zipFile = new ZipFile(tempFile);it runs smooth, no issues, if I run my app, the following line throws a FileNotFoundException...
    ZipFile zipFile = new ZipFile(tempFile);

  • File upload using Servlets and Weblogic

    Hi,
    I need to write a servlet that can upload a .doc file to a folder on the server. Can someone please let me know abot the code i need to write, as i am a novice in servlets.
    Thanks in advance
    buddy0303

    Another, simpler (we think), such package is Jenkov HTTP Multipart File Upload. It's a servlet filter which can work in front of both servlets and JSP's. The servlet filter parses the uploaded file and stores it temporarily on the servers disk. When the servlet or JSP executes afterwards, it can obtain all the information about the file, from the request attributes. There is a decent manual for HTTP Multipart File Upload on the website.
    Just search for "Jenkov HTTP Multipart" on Google and you'll find it. HTTP Multipart is free, open source, Apache Licsense.

  • Name of uploaded file (BLOB) in Servlet

    Hi,
    I'm trying to save into DB any file I want throw servlet via POST request.
    Is there any way how to get the name of uploaded file from posted information (from posted file).
    Then I save this file as BLOB into DB.
    Can you help me with getting the file name???
    Because I would like to save the name also into DB...
    Thanks Jan

    Jason Hunter of Servlet fame and fortune has had a general servlet framework extension available for quite a while now. This has code which supports many common operations, including handling multipart-file upload.
    See http://www.servlets.com/cos/index.html#classes and more specifically http://www.servlets.com/cos/javadoc/com/oreilly/servlet/MultipartRequest.html
    The code is available, so you should be able to take a peek and see how he handles this issue, as an example.
    cheers
    -steve-

  • How to get InputStream of uploaded file from request?

    The situation:
    Client is uploading xml file to server.
    <form METHOD=POST ENCTYPE = "multipart/form-data" action="SendFile" accept="text/xml">
              <input type="file" name="SentFile" />
              <input type="submit" value="go"/>
    </form>Then I need to parse data from file.
    I want to use method javax.xml.parsers.DocumentBuilder.parse(InputStream is)
    But, how to get InputStream of uploaded file from request?

    You cannot get the InputStream of the uploaded file directly. The InputStream you can obtain from request.getInputStream() contains a lot of other data as well as the uploaded file. You will have to parse the data in the InputStream to find the data that belongs to the file.
    A short cut is to use the HTTP Multipart File Upload available from www.jenkov.com. It simplifies file upload and makes it easy to obtain an InputStream for only the uploaded file. It also handles upload of multiple files. It is free, open source, Apache license, so if it doesn't fit your needs, you can always read the code and see how it works. Then write your own upload servlet.

  • Unknow trouble in File upload :

              Hi,
              I am doing a file upload using a multi part form page and a servlet. I am also
              doing file size validation and redirecting the user to the same page with error
              message, if the size is more than 20 KBs.This is potentially to avoid users from
              trying to upload huge files and flood the system.
              But if the upload file size is more than 30 KBs, it looks like the server(weblogic
              5.1) does something crazy.
              1) Netscape throws the following error message "Connection Reset By Peer".
              2) IE throws "Page cannot be displayed" error message.
              The servlet size is 7 KBs.Is this something to do with the size or stream
              being forwarded back to the browser and the server not able to handle this?Any
              thoughts?
              Thanks!
              

              I am not sure whether I am making it clear.I absolutely do not have any problem
              in uploading the file.The problem I have is when redirecting the user to the same
              page when the file size is more than 30kbs.I have attached the code.
              THorner <[email protected]> wrote:
              >I know from experience that one of the constructors in the O'Reilly
              >package has a default maximum file size, and exceeding this causes
              >problems in such a way that it is very hard to find the cause. If you
              >are using the o'reilly packages try using a different constructor, if
              >not then there may be an analogous problem
              >
              >terry
              >
              >> -----Original Message-----
              >> From: Kevin L. Burns [mailto:[email protected]]
              >> Posted At: Wed 01 August 2001 02:07
              >> Posted To: weblogic.developer.interest.servlet
              >> Conversation: Unknow trouble in File upload :
              >> Subject: Re: Unknow trouble in File upload :
              >>
              >>
              >> That's very odd. I wrote my own multipart/file upload
              >> classes and never
              >> had a problem with files over 30kB. It may be something with the
              >> classes you're using.
              >>
              >> San wrote:
              >> >
              >> > Hi,
              >> > I am doing a file upload using a multi part form page
              >> and a servlet. I am also
              >> > doing file size validation and redirecting the user to the
              >> same page with error
              >> > message, if the size is more than 20 KBs.This is
              >> potentially to avoid users from
              >> > trying to upload huge files and flood the system.
              >> > But if the upload file size is more than 30 KBs, it
              >> looks like the server(weblogic
              >> > 5.1) does something crazy.
              >> > 1) Netscape throws the following error message "Connection
              >> Reset By Peer".
              >> > 2) IE throws "Page cannot be displayed" error message.
              >> > The servlet size is 7 KBs.Is this something to do with
              >> the size or stream
              >> > being forwarded back to the browser and the server not able
              >> to handle this?Any
              >> > thoughts?
              >> >
              >> > Thanks!
              >>
              >
              [upload.txt]
              

  • $200 reward to solve problem with JDBC and CLOB.getCharacterOutputStream

    I'm trying to update CLOB with the getCharacterOutputStream as suggested in the example code. It works with US7ASCII DB instance but not instances in UTF8.
    I've been browsing through all the Oracle doc's and found some rather confusing statements:
    In the page at http://oradoc.photo.net/ora816/java.816/a81354/oralob2.htm#1043220
    it says: [When writing to or reading from a CLOB, the JDBC drivers perform all character set conversions for you.]
    also: [The oracle.sql.CLOB class supports all the character sets that the Oracle data server supports for CLOB types.]
    So far so good.
    In the page at http://oradoc.photo.net/ora816/java.816/a81354/oraint3.htm#1012518
    it says [The oracle.sql package supports these datatypes in several ways: CLOBs point to large fixed-width character data items (that is, characters that require a fixed number of bytes per character) and are supported by the oracle.sql.CLOB class.]
    Ooh no! Is this for real? UTF8 is variable width and does this mean it is not supported?
    Any way to get around this?
    In the page at http://oradoc.photo.net/ora816/java.816/a81358/03_pub2.htm#36009
    says [6.The mappings to oracle.sql classes are optimal because they preserve data formats and require no character-set conversions (apart from the usual network conversions). Those classes are especially useful in applications that "shovel" data between SQL and Java.]
    "No character set conversion"? Very confusing!
    I've been hammering on this CLOB/JDBC/UTF8 problem for more than a week now and I really appreciate some solutions, workarounds, or whatever help I can get. I'm running java stored procedure in 8.1.6 on Linux RH6.2.
    For your trouble, I'd pay $200 for the first guy who come up with a verifiable solution.

    This is just findings based upon your comments:
    Please refer to document Oracle8i National Language Support Guide
    Release 2 (8.1.6) from Oracle Documentation Library, Release 8.1.7
    Chapter 6 Java,
    There its clearly mention that:
    "Oracle JDBC drivers provide globalization support by allowing users to retrieve data from or insert data into a database in any character set that Oracle supports. Because Java strings are UCS2 encoded (16-bit Unicode) for JDBC programs, the target character set on the client is always UCS2. Character set conversion is required to convert data from the database character set (Db Charset) to UCS2. This applies to CHAR, LONG, CLOB, and VARCHAR2 data types; RAW data is not converted. "
    Also..please refer this...
    "oracle.sql.CLOB's method getCharacterStream() returns the contents of a CLOB as a Unicode stream."
    "The techniques that Oracle's drivers use to perform character set conversion for Java applications depend on the character set the database uses. The simplest case is where the database uses a US7ASCII or WE8ISO8859P1 character set. In this case, the driver converts the data directly from the database character set to UCS2,which is used in Java applications. "
    "If you are working with databases that employ a non-US7ASCII or non-WE8ISO8859P1 character set (for example, Japanese or Korean), then the driver converts the data, first to UTF8, then to UCS2. "
    In my case the characte-set of the database is WE8ISO8859P1 and for security reason i can't change the character set but my feeling is that if you are updating the CLob from the java client you are forming a reference of a clob in the client which is UCS2 at the Java side. Now when you are populating the clob through java.io.Writer and call the procedure to pass the reference of the clob to the procedure then I believe the JDBC will convert the UCS2 datatype of Clob to UTF8 in the database.
    You can try out the code snippet:
    package ServletGDC;
    import java.io.*;
    import java.util.*;
    import javax.servlet.*;
    import javax.servlet.http.*;
    import oracle.sql.*;
    import java.sql.*;
    import oracle.jdbc.driver.*;
    import ClassesGDC.*;
    public class testUpload extends HttpServlet {
    private String m_strMessage="";//It stores the message to be uploaded along with the Document
    Connection conn=null;
    public void doPost(HttpServletRequest req, HttpServletResponse res)
    throws ServletException, IOException {
    String strContent="";
    //res.setContentType("application/msword");
    res.setContentType("text/html");
    PrintWriter out = res.getWriter();
    try {
    CallableStatement cmt=null;
    OutputStream output=null;
    ByteArrayOutputStream byteoutput=null;
    String strDocString="";
    oracle.sql.CLOB tempClob = null;
    String strPassedFileName="";     // the file name passed in the request object
    String strStdFilename="";//the file name to be given to the best practice
    String strSaveDirectory="";     //the directory in which the bp is to be saved
    String strParamName="";//name of parameters
    String strParamValue="";//value of parameters
    int intTempVariable=0; // temporaty variable
    long lngSizeOfFileUploaded=0;//stores the size of the file which had been uploaded in the file system
    File filePathOfFileUploaded=null;//stores the path of the file uploaded to the file system
    String strQuery="";
    //ST------------checks if the user has logged in or not-----------------------
    HttpSession session=req.getSession(true);
    if(req.getContentLength()>20*1024*1024)
    throw new skip("The size of the posted content is more than 10 MB . If you have a best practice whose size is more than 1 MB please mail it to Us.");
    byteoutput = new ByteArrayOutputStream();
    MultipartParser mp = new MultipartParser(req, 20*1024*1024); // 10MB is the limit of the file to be uploaded
    Part part;//Its an abstact part which helps in retrieving information about the file and the parameters
    while ((part = mp.readNextPart()) != null) {//Reads the next part
    strParamName = part.getName();
    // the following if is executed if the part is for a parameter rather than a file
    if (part.isParam()) {
    }else if (part.isFile()) {
    // it's a file part
    m_strMessage="inside file part";
    FilePart filePart = (FilePart) part;
    strPassedFileName = filePart.getFileName();
    strContent= filePart.getContentType();
    out.println("<BR><font color=red>strPassedFileName is "+strPassedFileName+"</font>");
    if(strPassedFileName != null || !(strPassedFileName.trim().equals("")) ) {
    // the part actually contained a file
    out.println("<BR><font color=red> before forming long</font>");
    //lngSizeOfFileUploaded = filePart.writeTo(filePathOfFileUploaded);      //the statement upload the bestpractice in the
    lngSizeOfFileUploaded = filePart.writeTo(byteoutput);     //specified file path filePathOfFileUploaded.
    out.println("<BR><font color=red> after file is written into the outputstream</font>");
    else {
    throw new skip("The file name is null or it is empty space. Files in such Format are not accepted");
    }//end of else if
    }//end of while loop
    if(     lngSizeOfFileUploaded==0)     {// the size of the file uploaded is zero then the file supplied was not proper and hence exception is to be thrown
    //if(filePathOfFileUploaded.exists())
    //     filePathOfFileUploaded.delete();
    throw new skip("The File could not be uploaded,Possible reasons may be that the file is sent null or the file is corrupted");
    //END---------------the file is uploaded in the proper directory--------------------
    //res.setContentType(strContent);
    out.println("<BR><font color=red>long value is : "+lngSizeOfFileUploaded+" and content is "+strContent+"</font>");
    String strbyte= byteoutput.toString();
    byteoutput.flush();
    Class.forName("oracle.jdbc.driver.OracleDriver");
    // Establish network connection to database
    conn = DriverManager.getConnection("jdbc:oracle:thin:@pc-p32670:1521:GDCDBI","gdc_user","myuser");
    //if(conn!=null)
    out.println("<BR><font color=red>Connection formed"+conn);
    //els
    //out.println("<BR><font color=red>long value is : "+strbyte+"</font>");
    try{
    tempClob = oracle.sql.CLOB.createTemporary(conn,true, oracle.sql.CLOB.DURATION_SESSION);
    out.println("<BR><font color=red>tempClob : "+tempClob);
    tempClob.open( oracle.sql.CLOB.MODE_READWRITE);
    java.io.Writer tempClobWriter = tempClob.getCharacterOutputStream();
    // writing the string formed from the multipart file to the clob
    tempClobWriter.write(strbyte);
    if(tempClob!=null){}
    out.println("<BR><font color=red>CLOB value is : "+tempClob+"</font>");
    strQuery="{call INSERT_CLOB(?,?)}";
    cmt=conn.prepareCall(strQuery);
    cmt.setString(1,strPassedFileName);
    cmt.setClob(2,tempClob);
    cmt.registerOutParameter(2,java.sql.Types.CLOB);
    cmt.execute();
    tempClobWriter.flush();
    tempClobWriter.close();
    tempClob.freeTemporary();
    //res.setContentType(strContent);
    //strDocString.toString();
    out.println("<BR><font color=red>bob is "+strbyte+"</font>");
    tempClob.close();
    }catch(Exception e){
    tempClob.close();
    out.println("<font color=blue> Error is :"+e.getMessage()+"</font>");
    //e.printStackTrace(out);
    cmt.close();
    //out.println("<BR><font color=red><h2><b>SUCCESS</h2></font>");
    //res.sendRedirect("../test/showfile.jsp?contentype="+strContent.trim()+"");
    }catch(Exception e){
    java.util.Date d = new java.util.Date();
    String s =d.toString();
    out.println("<font color=blue> Error is :"+e.getMessage()+"</font>");
    //e.printStackTrace(out);
    }finally{
    try{
    if(conn!=null)
    conn.close();
    }catch(Exception e){
    out.println("<font color=blue> Error is :"+e.getMessage()+"</font>");
    }// end of finally
    } //end of doPost
    } //end of class
    in the Procedure you will be inserting/updating the clob in a table with the reference clob in the out parameter of the procedure
    Thanks.

  • Post messages on the jsp page

    This is my jsf(jsp) page:
    <%@ page language="java" contentType="text/html; charset=ISO-8859-1" pageEncoding="ISO-8859-1"%>
    <%@ taglib prefix="f"  uri="http://java.sun.com/jsf/core"%>
    <%@ taglib prefix="h"  uri="http://java.sun.com/jsf/html"%>
    <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
    <html>
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
    <title>Insert title here</title>
    </head>
    <body>
    <f:view>
    <h1 align="center">File Selection Page</h1>
    <h:panelGroup>
    <form id="uploadForm" method="post" action="Multipart.do" enctype="multipart/form-data">
        Specify your name:<br />
        <input type="text" name="name"><br /><br />
        Specify your files: <br />
        <input type="file" name="file1"><br /><br />
         <input type="file" name="file2"><br /><br />
         <input type="file" name="file3"><br /><br />
        <input type="file" name="file4"><br /><br />
    <br><br>
    <center>
    <input type="submit" name="Submit" value="Submit Your Files">
    </center>
    </form>
    </f:view>
    </body>
    </html>I am using apache commons multipart file upload. How do I post success or failure messages to this page?
    As you see I am using a servlet(not shown - which uses Faces Context to populate the messages). Not sure how to get these out in the jsp page.
    Thanks,
    Sonia
    Edited by: sun_sonia on Nov 23, 2009 2:42 PM

    You're using plain HTML <input type="file"> elements. Use Tomahawk's <t:inputFileUpload> components instead of you want to make use of JSF's validation and messaging capabilities.
    If you insist in using a servlet instead of a bean for this, then just do all the usual JSP/Servlet way. My suggestion would be to hold a Map<String, String> which contains the fieldname-message pairs which you store in the request scope and then use the usual JSP/EL way to display them.

  • Problems converting access database to excel

    is there any method to convert access db to excel spreadsheet.
    currently i'm using a 'cheat' way of retrieving the results to a table and convert to excel using this:
    response.setContentType("application/vnd.ms-excel");
    response.setHeader("Content-Disposition","attachment; filename=\"file.xls\";");
    the problem is that i need to delete the records in the database after saving the the excel file. this method does not let me perform response.sendRedirect() method after saving as excel. so, after i retrieve the results into a table, i delete the records in the database and prompt the user to save the excel file. this is risky cos if the user select cancel when prompted to save, the records in the databse will long be gone.
    i need help if anyone could suggest a solution to this.
    1. another method to convert access db to excel spreadsheet , or
    2. the excel file will be saved automatically without having the user to click to save, or
    3. to be able to get to delete the db records after saving.
    i really need the help from you people. thanks.

    I find your problem description confusing.
    Here's what it sounds like you're saying:
    You've got records in an Access database to start with. A user makes a request to see records in a browser. You've got a servlet that queries the Access database using JDBC, turns the result set into a CSV file, sets the content type to "application/vnd.ms-excel", and then displays the response as an MS Excel spreadsheet in the browser.
    So far, so good?
    That sounds like one use case to me - call it "Query Database For Records".
    Then it sounds like you want to implement another use case - call it "Modify Database". You'd like to be able to let the client manipulate the Excel data you've sent down and then resynch with the database when they say they're done.
    Again, okay?
    If that's true, treat them like two separate cases. It sounds like you want to do a multipart file upload of the Excel data where you'd have your servlet take the uploaded data and insert it back into the Access database.
    If I understand you correctly, Access is your persistence mechanism. I don't understand why you'd want to update Access AND save the Excel file. I read this as "I want to have one data source of record with the latest info, and I happen to like sending it down to clients in an Excel spreadsheet because that's what they're used to seeing."
    I'm sure this doesn't help you solve your problem yet, but it might help my understanding of what you're really trying to do here. - MOD

  • Uploading local package problems in 11g

    I've tried to add a package to the "Local PKGs" section of the local content. I can install the package manually without issue but when I upload it into "Local Content" it ends up with the "Broken Rules (Missing Dependencies)" state. When the package is in that state I can't use it in operational profiles.
    I've checked the emoc.log but all I can find is it says "No Dependencies".
    Any idea what I'm missing on the upload? Or how to fix the "broken rules"?
    Thanks.

    We are using the Multipart request in the Oracle 8i Application server(with APache 1.3 as web server) itself. For that matter we didn't set any classpath separetly in the jserv.properties file of the Application server. Only the classes relating to the Multipart files are to be referenced with all other classes of whichever appliaction you are creating and that can be put in the proper package within the classes folder of the Web-Inf where generally the classes are referenced. OI guess that will certainly work in Oracle 9i AS.
    Thanks.

  • HTTP Post of ByteArray

    Hello, I hope this is the right place for this question.
    In the first set of code below, I create a request using a ByteArray as my binary data. The server doesn't recognise it as a valid file and does not work. If I perform all the same tasks but write the ByteArray to a temporary file and then read it out again, everything works fine. What am I missing?
    I am trying to POST binary data via HTTP. My original code, which almost works looks like so:
                dataString += twoHyphens + boundary + lineEnd;
                dataString += "Content-Disposition: form-data; name=\"Filedata\"; filename=\"" + entity.fileName +"\"" + lineEnd;
                dataString += "Content-Transfer-Encoding: binary" + lineEnd;
                dataString += "Content-Type: application/octet-stream; name=" + entity.fileName + lineEnd;
                dataString += lineEnd;
                outputBytes.writeMultiByte(dataString, "ascii");
                outputBytes.writeBytes(dataArray);
                outputBytes.writeMultiByte(lineEnd, "ascii");
    This does work:
                dataString += twoHyphens + boundary + lineEnd;
                dataString += "Content-Disposition: form-data; name=\"Filedata\"; filename=\"" + entity.fileName +"\"" + lineEnd;
                dataString += "Content-Transfer-Encoding: binary" + lineEnd;
                dataString += "Content-Type: application/octet-stream; name=" + entity.fileName + lineEnd;
                dataString += lineEnd;
                outputBytes.writeMultiByte(dataString, "ascii");
                var fileStream:FileStream = new FileStream();
                var tempDirectory:File = File.createTempDirectory();
                var tempFile:File = tempDirectory.resolvePath(entity.fileName);
                try {
                    fileStream.open(tempFile, FileMode.WRITE);
                    fileStream.writeBytes(dataArray);
                    fileStream.close();
                    fileStream.open(tempFile, FileMode.READ);
                    fileStream.readBytes(dataArray);
                    fileStream.close();
                catch(error:Error)
                    trace(error.getMessage());
                    return;
                outputBytes.writeBytes(dataArray);           
                outputBytes.writeMultiByte(lineEnd, "ascii");

    I was able to answer my own question. All I needed was to set my loader's data format:
    loader.dataFormat = URLLoaderDataFormat.BINARY;
    I can't begin to guess why writing the ByteArray to a temporary file and reading it out again would make the loader choose the right format.
    (And yes, this is in AIR)
    Functional Multipart File Upload Code if anyone else needs it:
                var outputBytes:ByteArray = new ByteArray();
                var loader:URLLoader = new URLLoader();
                var createRequest:URLRequest = new URLRequest(BasePath.url + "create.xml");
                var acceptHeader:URLRequestHeader = new URLRequestHeader("Accept", "*/*");
                var aliveHeader:URLRequestHeader = new URLRequestHeader("Connection", "Keep-Alive");
                var dataString:String = "";
                // File Data
                dataString += twoHyphens + boundary + lineEnd;
                dataString += "Content-Disposition: form-data; name=\"Filedata\"; filename=\"" + entity.fileName +"\"" + lineEnd;
                dataString += "Content-Transfer-Encoding: binary" + lineEnd;
                dataString += "Content-Type: application/octet-stream; name=" + entity.fileName + lineEnd;
                dataString += lineEnd;
                outputBytes.writeMultiByte(dataString, "ascii");          
                outputBytes.writeBytes(entity.data as ByteArray);           
                outputBytes.writeMultiByte(lineEnd, "ascii");
                // Other Data
                var key:String = "someparam";
                var value:String = "somevalue";
                outputBytes.writeMultiByte(twoHyphens + boundary + lineEnd, "ascii");
                outputBytes.writeMultiByte("Content-Disposition: form-data; name=\"" + key + "\"" + lineEnd + lineEnd);
                outputBytes.writeMultiByte(value + lineEnd);
                // End Request
                outputBytes.writeMultiByte(twoHyphens + boundary + twoHyphens + lineEnd, "ascii");
                createRequest.method = URLRequestMethod.POST;
                createRequest.requestHeaders.push(acceptHeader);
                createRequest.requestHeaders.push(aliveHeader);
                createRequest.contentType = "multipart/form-data; boundary=" + boundary;
                createRequest.data = outputBytes;
                loader.dataFormat = URLLoaderDataFormat.BINARY;           
                loader.addEventListener(Event.COMPLETE, createEntityCompleteHandler);
                loader.addEventListener(IOErrorEvent.IO_ERROR, ioErrorHandler);
                try    {               
                    loader.load(createRequest);
                catch(ie:IOError) {
                    trace(ie.getMessage());
                catch(ex:Error) {
                    trace(ex.toString());

Maybe you are looking for

  • Table of Contents in Word to bookmarks in Acrobat

    I am using Adobe Acrobat 8.  I have a Microsoft Word file that I have created a table of contents in.  I would like to convert it to pdf and have the links in the table of contents show up as bookmarks automatically.  How can I do this?

  • Computer gets HOT!

    I have my MacBook Pro on for about 20 minutes before the back left part of the computer gets extremely hot. It's been constantly updated, etc. Also, I've reset/shut down the computer for several hours to cool down. It still gets hot even when I have

  • Handling Unit label (V6) - multiple printers configuration

    I would like to print the handling unit label (V6) in multiple printers. Currently the condition records are set to plant/Packaging material combination with printing in one printer. I would like to have the ability to print to different printer in H

  • Help - K8N Neo4 SLI - sound inputs TOO LOUD! (SoundBlaster Live!)

    I have two sources for Line In sound; XM Radio and  Leadtek TV Tuner Card.  In both cases, the sound going from the card is so loud it is distorted even at only 1% of volume on the Soublaster Mixer.  This happens whether I plug them into my Line In o

  • Case sensitivity in mssql

    i have a table with lower case and upper case for eg; Bookid   Book_Title    keyword 001        New Fashion  Fashion 002        GOURMET    GOURMET 003        orange           orange when select from the table , i face the problem select from book_tab