Results 1 to 10 of 10

Thread: Hello

  1. #1
    Chintan is offline Member
    Join Date
    Jan 2009
    Posts
    1
    Rep Power
    0

  2. #2
    Eranga's Avatar
    Eranga is offline Moderator
    Join Date
    Jul 2007
    Location
    Colombo, Sri Lanka
    Posts
    11,372
    Blog Entries
    1
    Rep Power
    19

    Default

    Hi Chintan,

    Welcome to our community.

    Please read our FAQ page before posting again. It's really helpful to you. You have introduce to the forum in wrong section. I'll move this thread to the correct place this time. Please choose the correct one next time.

  3. #3
    davejay is offline Member
    Join Date
    Jan 2009
    Posts
    9
    Rep Power
    0

    Smile Java Buzzer

    Hello Everyone!!!:)

  4. #4
    Eranga's Avatar
    Eranga is offline Moderator
    Join Date
    Jul 2007
    Location
    Colombo, Sri Lanka
    Posts
    11,372
    Blog Entries
    1
    Rep Power
    19

  5. #5
    davejay is offline Member
    Join Date
    Jan 2009
    Posts
    9
    Rep Power
    0

    Default

    My pleasure..

  6. #6
    davejay is offline Member
    Join Date
    Jan 2009
    Posts
    9
    Rep Power
    0

    Default

    hey,
    i have create a program which i can copy the image file in a specific folder. In this case whenever i run the program every time the copied image was replace by a new one i just want to append the copied image without replacement. How could i do this. Any idea??
    thx..

  7. #7
    Eranga's Avatar
    Eranga is offline Moderator
    Join Date
    Jul 2007
    Location
    Colombo, Sri Lanka
    Posts
    11,372
    Blog Entries
    1
    Rep Power
    19

  8. #8
    davejay is offline Member
    Join Date
    Jan 2009
    Posts
    9
    Rep Power
    0

    Default

    sure..
    he is the code i had used
    try {
    String s2=fd.getDirectory ( ) + fd.getFile ( ) ;
    String paa=fd.getFile ( ) ;
    //String path1=fd.getDirectory ( );
    String path1="D:training\\";
    boolean sucess=new File((path1)).mkdir();

    /////////////////////////////////
    try{
    File f1 = new File(s2);
    String dtFile=path1+"file1.jpg";
    File f2 = new File(dtFile);

    FileInputStream in = new FileInputStream(f1);
    //For Overwrite the file.
    FileOutputStream out = new FileOutputStream(f2);
    ///////////////////////////////////////////////////////////////////
    byte[] buf = new byte[1024];
    int len;
    while ((len = in.read(buf)) >0){
    out.write(buf,0,len);
    //ic.transferTo(0,ic.size,oc);
    }
    in.close();
    out.close();
    System.out.println("File copied.");
    }catch(FileNotFoundException ex){
    System.out.println(ex.getMessage() + " in the specified directory.");
    System.exit(0);
    }

  9. #9
    Eranga's Avatar
    Eranga is offline Moderator
    Join Date
    Jul 2007
    Location
    Colombo, Sri Lanka
    Posts
    11,372
    Blog Entries
    1
    Rep Power
    19

  10. #10
    davejay is offline Member
    Join Date
    Jan 2009
    Posts
    9
    Rep Power
    0

    Default

    hey i got the solution. i used the same code but the difference is i called the image twice and at the second time of calling i just overwrite the first one using the same string function..;)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •