why text file store in unix operating system can't be read


DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 2 of 2

Thread: why text file store in unix operating system can't be read

  1. #1
    Join Date
    Dec 2005
    Posts
    7

    Question why text file store in unix operating system can't be read

    I have promblem .Currently i using both jsp and io class in to store value in a text file and mysql database .The promblem is that I can view in window platform the content of the text file ,but not in UNIX platform . Below are the syntax
    <%
    //String save2 = request.getParameter("flag");
    String fileName = request.getParameter("fileName"); //get file name from download_process.jsp
    String usr = request.getParameter("usr");
    String passwd = request.getParameter("passwd");
    System.out.println("f " +fileName);

    String s[] = fileName.split(":");
    String file1 = s[0];
    String file2 = s[1];
    System.out.println("fiel " +file2);
    response.setContentType("text");
    response.setHeader("Content-Disposition","attachment;filename=" + file2);

    int Read1;
    FileInputStream stream1 = null;
    try {
    File f = new File("c:/mysql/data/mrs/download/" +file2);
    System.out.println("ff " +f);
    stream1 = new FileInputStream(f);

    System.out.println("stea " +stream1);
    while ((Read1 = stream1.read()) != -1){
    out.write(Read1);
    }//end while
    out.flush();
    }//end try
    finally {
    if (stream1 == null){
    stream1.close();
    }//end if
    }//end finally
    %><%@ page import="java.io.*,javax.servlet.*,java.util.*, java.util.Date, java.util.Calendar, java.text.SimpleDateFormat "%>
    the file is currently stored in window operating system and upload into unix operating system . And display line is to long and all the values are replaced with @ . Don't understand why.Please help me

    thank you for your kind attendtion .thank you
    Last edited by sarasahg; 12-13-2005 at 05:54 AM.

  2. #2
    Join Date
    Sep 2005
    Location
    istanbul / Turkey
    Posts
    133
    "c:/mysql/data/mrs/download/"
    this is not a unix absolute pathname.
    they dont use harddisk names like "C:" .
    http://www.faqs.org/docs/javap/c10/s2.html

Similar Threads

  1. Reading and writing lines from a text file...
    By Jenks in forum VB Classic
    Replies: 6
    Last Post: 05-24-2005, 03:22 PM
  2. File Locking a Text File on a Network Drive
    By Miles Tones in forum VB Classic
    Replies: 1
    Last Post: 05-20-2005, 02:57 PM
  3. wav file fade in out help
    By jase_dukerider in forum C++
    Replies: 2
    Last Post: 04-14-2005, 08:48 PM
  4. Can a text file be read using ADO?
    By Ted Young in forum VB Classic
    Replies: 1
    Last Post: 08-21-2000, 10:47 PM
  5. Replies: 0
    Last Post: 04-17-2000, 02:33 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center