Problem with added carrige returns in download of fixed length records.

Hi,
I'm hoping that someone can help me, I'm at a complete loss.
I am downloading fixed length text records from our extranet via JSP. The problem is that 8 addtional carrige returns are being added to the records somewhere during this process, rendering the files useless. The following is the code I'm using
<%
FileInputStream fInputStream = null;
String piccareD = "/usr/local/apache/tomcat/webapps/piccare/";
String filePath = piccareD + "x/" + request.getRemoteUser() + "/dnload/";
String fileName = request.getParameter("fileName");
int ch;
String dnloadFile = filePath + fileName;
response.setContentType("application/octet-stream");
response.setHeader("Content-Disposition", "attachment;filename=" + dnloadFile);
Connection con = ConnectionServlet.getConnection();
try
  fInputStream = new FileInputStream(dnloadFile);
  while ( (ch = fInputStream.read() ) != -1)
      out.write(ch);
  log.logEvent(con, LogElement.DNLOAD, fileName);
  log.setRetrieved(con, fileName, tStamp.getStamp());
  if( ! (fileName.indexOf("archive/") > -1) )
       String proc = "mv " + dnloadFile + " " + filePath + "archive/" + fileName;
       Process mv  = Runtime.getRuntime().exec( proc );
       Thread.sleep(100);
       int ec = mv.exitValue();
       mv.destroy();
       System.err.println( ec );
       if( ec != 0 )
} catch (Exception e) {
        System.err.println(e.getMessage());
        log.logEvent(con, LogElement.DNLOAD_ERR, fileName);
%>Any help is sincerely appreciated.
Thank you!
[email protected]

You might try setting the buffer size to 0 for the jsp page and see if that helps.

Similar Messages

  • Problems with adding Library for a MySQL JDBC driver

    Good day,
    I am new with the JDeveloper package, so the following could be a user fault.
    I found the following:
    - I downloaded and installed Oracle JDeveloper 10.1.2.1.10 (latest version).
    - I downloaded the latest JDBC drivers for MySQL. ( mysql-connector-java-3.1.10 )
    Now, I did the following steps extracted from the link http://www.oracle.com/technology/products/jdev/tips/duff/mysql_and_oc4j3.html it should be quite easy to add the JDBC Drivers to the project.
    I did the steps with the following results:
    When I Edit the Project properties, follow Profiles -> Development -> Libraries
    When I do ' New' , fill in at JS2E the value 'MySQL' and fill in the Class Path (in my case 'C:\javaInstalls\mysql-connector-java-3.1.10\mysql-connector-java-3.1.10-bin.jar').
    In that case the [OK] is disabled. I should expect the [OK] button was enabled!
    My question: Is this a bug? When not, what am I doing wrong!
    Regards,
    Mike

    I tried it on an other system and had no problems with adding the libraries. It still is a problem on that particular system using the Dutch version of XP. The problem is that the Ok button stays disabled !
    Could it bw a version problem with Java? How ever no changes are made to the original configuration, so it should pick up as default the java version of JDeveloper self.

  • Problem with adding Sun JSF RI v1.2 as a new library in JDeveloper 10.1.3.1

    Hi,
    I have a problem with adding a latest JSF 1.2 RI from Sun (https://javaserverfaces.dev.java.net/files/documents/1866/44998/jsf-1_2_03.zip) to JDeveloper as a new library.
    I created a new User library and added into it jsf-impl.jar and jsf-api.jar from JSF 1.2 RI.
    Then I try to create two new JSP Tag libraries based from .tld files.
    When a .tld file is placed in "TLD File:" field there is no information below about Library Version and Required JSP Version. If I check "Execute Tags in JSP Visual Editor" and click "Customize" button - list of tags in "Customize Tag Library" window is empty.
    I have errors when I try to use JSF Tags from this new library in JSP page like :
    "Can't create tag instance: f:view (class: null). Make sure, that the tag class or a library contained this class is available in this application"
    (free translation to English)
    Is this possible to add JSF RI v1.2 as another library in Jdeveloper 10.1.3.1 ?
    thanks for help
    koli

    Hi,
    This solution is not exactly for Jdeveloper 10.1.3.x I think.
    - "Create a JSF system library." section, point 2. - there is not possible to add library in folder other than User I see, so I added it in User folder.
    - "Register the JSF JSP tag libraries." section, point 5. - in JD 10.1.3 there is no dialog box, I checked checkbox "Show Tag Library in Palette". A new library was added to User folder but there is no new libraries in component Palette.
    Even as I use "Edit tag libraries .." from Component Palette context menu and add manually new tag libraries to selected, there is no libraries in Component Palette after it.
    I feel so problem is with different .tld files format, not with adding libraries method.
    Sun RI tld file (from version 1.2_03) fragment:
    <taglib xmlns="http://java.sun.com/xml/ns/javaee"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-jsptaglibrary_2_1.xsd"
    version="2.1">
    <!-- ========== Tag Library Description Elements ========================= -->
    <description>
    The core JavaServer Faces custom actions that are independent of
    any particular RenderKit.
    </description>
    <tlib-version>1.2</tlib-version>
    <short-name>f</short-name>
    <uri>http://java.sun.com/jsf/core</uri>
    tld included in JD:
    <!DOCTYPE taglib
    PUBLIC "-//Sun Microsystems, Inc.//DTD JSP Tag Library 1.2//EN"
    "http://java.sun.com/dtd/web-jsptaglibrary_1_2.dtd">
    <taglib>
    <!-- ========== Tag Library Description Elements ========================= -->
    <tlib-version>1.0</tlib-version>
    <jsp-version>1.2</jsp-version>
    <short-name>f</short-name>
    <uri>http://java.sun.com/jsf/core</uri>
    <description>
    The core JavaServer Faces custom actions that are independent of
    any particular RenderKit.
    </description>
    Did JDeveloper 10.1.3.x maintain with taglib version 1.2 ?
    Regards
    koli

  • HT5312 So I have a problem with iTunes not letting me download anything without first responding to some security questions which I don't remember setting up, how can fix it? Oh, and it won't let me reset the questions either!

    So I have a problem with iTunes not letting me download anything without first responding to some security questions which I don't remember setting up, how can fix it? Oh, and it won't let me reset the questions either!

    If you mean that you aren't getting the reset link, then from the page that you posted from :
    Note: The option to send an email to reset your security questions and answers will not be available if a rescue email address is not provided. You will need to contact iTunes Store support in order to do so. 
    You can contact iTunes Support in your country via this page : http://support.apple.com/kb/HT5699
    When they've been reset you can then use the steps half-way down the HT5312 page that you posted from to add a rescue email address for potential future use

  • [SOLVED] Problem with adding a SSH connection to startup

    Hi guys. I have a problem with adding ssh connection to startup. i want this command to run before kde login screen  and keep running all time.
    ssh -D 9292 remoteuser@remotehost
    but it doesnt connect. Thanks for help!
    Last edited by alperenel (2011-03-11 00:10:27)

    cactus wrote:
    ssh -fN -D 9292 remoteuser@remotehost
    you need -f, which sends ssh to the background, and -N which does not execute a remote command.
    If you need it to run as a user other than root, then you probably need to utilize su as well.
    it didnt work either. i am putting it in rc.local but doesnt work.

  • Problem with adding new field to the mass change screen in FBL5N

    Hi,
    We have a problem with adding the field XREF3 to the mass change screen. We followed steps described in the SAP Note 640908, but the result is that when we try to mass change some documents in FBL5N and enter some values in the mass change screen, a message appears: "Please enter at least one new value" and nothing is changed.
    If you have faced with such a problem, we would be grateful if you give us some tips.
    Regards,
    Miłosz Włodarczyk

    The problem has been resolved: we didn't activate a code in SE80.

  • Im having a problem with my ps elements 8,download manager active x has encountered a problem

    im having a problem with my ps elements 8,download manager active x has encountered a problem
    adobe reader and acro manager has encountered a problem and needs to closed
    -+++reg.exe has encounter a problem
    -invidia graphics driver has stopped working properly.

    Check out this link if any of the information in there can help you move forward:
    http://kb2.adobe.com/cps/400/kb400530.html
    Regards,
    Ankush

  • I had problems with my laptop which have now been fixed but I cant access my itunes account or download itunes

    I had problems with my laptop which have now been fixed but I am now unable to download or connect to my Itunes account through any of my devices?

    An iTunes account is nothing more than a login and password.
    The media is only where the user put it.  Restore the ENTIRE iTunes folder from the backup of the computer.

  • Problems with adding funds

    Hey guys , I have a problem with adding funds in my PSN account with my debit card . I have used the same card in the past with no problems at all but now for some reason it keeps on saying that the card number is invalid every single time ! Please help me , is there any solution ? Does it maybe has to do with Capital Control ( I live in Greece ) 

    Thanks I use this
    2.) You can make one of your buttons the default
    button of the frame:
    this.getRootPane().setDefaultButton(confirm);
    well, did you implement the first suggestion of quitte?
    here is an idea that might work!
    JTextField username;
    JPasswordField password;
    JButton confirmButton;
       username.addActionListener(new ActionListener(){
          public void actionPerformed(ActionEvent ae){
             password.requestFocus();                    
       ActionListener l = new ActionListener(){
          public void actionPerformed(ActionEvent ae){
             //optional check for username and password length>0
            //process logon.
       password.addActionListener(l);
       confirmButton.addActionListener(l);

  • I can't make a purchase with iTunes because it says there's a problem with the connection. How do I fix this?

    I can't make a purchase with iTunes because it says there's a problem with the connection. How do I fix this?

    Morning Gjakleinmark,
    Thanks for using Apple Support Communities.
    For more information on this, take a look at this article:
    Can't connect to the iTunes Store
    http://support.apple.com/kb/ts1368
    Best of luck,
    Mario

  • I bought an iphone 5 in the United States. It has major problems with the video. In Italy not fix it. What am I to do?? back in the United States

    I bought an iphone 5 in the United States. It has major problems with the video. In Italy not fix it. What am I to do?? back in the United States

    The iPhone warranty is not international. If you bought it in the US you can only get service in the US. You will need to take it in to an Apple store in the US.

  • HT2341 When I first attempt to power on my MacBook Pro, the LED blinks but the MBP doesnt turn on. However when I try a second time the LED blinks but my Mac turns on. Is this a problem with the hardware and can it be fixed?

    When I first attempt to power on my MacBook Pro, the LED blinks but the MBP doesnt turn on. However when I try a second time the LED blinks but my Mac turns on. Is this a problem with the hardware and can it be fixed?
    Also, I apparently have to replace my battery. Could the problem have any relevance to a dead battery?

    Have you held the power button down for 10+ seconds?  That should turn it off.
    Ciao.

  • Adapter file receiver - file with fix length record

    Hi everybody,
    In the file adapter receiver, I want to create a fixed length record file .
    Each record need to have the same size.
    How is it possible, because I have a file which contains variable legnth depending of the lenght of message?
    exemple:
    <mess>
       <row>1234567</row>
       <row>123456789A</row>
    </mess>
    give the file
    1234567<CR>
    123456789A<CR>
    <CR> means carriage return
    and I want a file like
    1234567   <CR>
    123456789A<CR>
    with the same lenth of record (10 in the example).
    Can anyone help me, ,please?
    Kind regards.
    E. Koralewski

    Hi Eric,
    Create a value user defined function with one input argument a and name it is inputpad. Then add the following code:
    Imports:  java.*;
    while (a.length()<Integer.parseInt("10"))
         a= a +" " ;
    return String;
    Here I am assuming your fixed length for the field is 10. If it is more or less then change the number. Now in your mapping do all your logic and then in the final add this like:
    input ---> your logic --> inputpad udf --> target.
    Regards,
    ---Satish

  • Problem with adding artwork manually in itunes

    I'm having trouble manually adding artwork to several albums in itunes 10.7 on macbook pro (the 'get album artwork' facility won't pick these discs up presumably because they're too obscure).
    I go to 'get info', select the relevant check box, then add a  non-read only, apparently normal jpg to the artwork box. This image then displays successfully in the artwork box, I press ok, but when I return to the albums list it won't display at all. This has been consistent problem that I haven't only experienced in this version of itunes and it's very irritating having just a few blank albums that refuse to change.
    Any ideas what might be causing this. Or is there a workaround or an alternative method I can use to add artwork?

    Thanks both for the responses.
    Limnos - I can't find an equivalent 'show artwork' function in the view menu in my version of itunes, and I'd rather not have step back to an older version of itunes if I can avoid it.
    BUT having thought about it I think the root of the problem must be that they are all albums with .flac files that have been imported into itunes using the 'Fluke' software. I suspect this might be what's causing the problem - and I'm wondering whether that means the problems with Fluke itself. It's annoying that there isn't a quality music player on mac that handles .flac and I have to use these crappy converters.
    If anyone has an idea about how to solve this please pitch in, but I suspect this goes beyond the remit of these forums.
    och well.

  • Problems with adding IOS IPS to IPS MC

    Hi,
    We are having problems in adding Cisco IOS IPS (Running on Cisco 1701,12.3(14)T2) into IPS-MC (Version: 2.1.0).
    The IPS MC is able to create the Trust Point on the Router and the Router is also able to download the IPS-MC certificate chain. However after that the process fails with the error
    ++++++++++++++++++++
    Import of sensor x.x.x.x failed.
    Error : Error importing configuration files from the sensor - Unable to import sensor config from IOS IPS: null
    ++++++++++++++++++++
    Any ideas ?
    Thanks \\ Naman

    I am having the same issue and open TAC case for several days..with 1841 and 2811's..same software and IOS
    It works with advipservices but not with advsecurity

Maybe you are looking for