hi all,
I have generated pdf file. I have to rename tht file and send as attachment in mail. problem here is its renaming and sending mail with renamed file as attachment but i am not able to find renamed file in local system.
Also sometimes its very inconsistent , its giving "File not found Exception"(for previous file name)
please see the following code....
String filename = "C:\\test2222.txt";
FileDataSource fds = new FileDataSource(filename);
File file = fds.getFile();
if ( file.exists() ) {
File file1 = new File(filename);
file1.renameTo(new File("05012004.txt"));
}
can u please tell me how to make copy of original file and then renaming that file with new name? will this solve my problem?
thanks in advance..