Skip to Main Content

Java Programming

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Sending a temp file as email attachment

807588Apr 14 2009 — edited Apr 14 2009
Hi there,
I create a temp file and then later in my program I send that file as email attachment.
The problem is since it's a temp file, it puts some number behind my file name. For ex. Test45690.txt
However, I don't want those number in my file name when I send that it as attachment, what should I do?
File temp = File.createTempFile(fileName, ".txt");
BufferedWriter out = new BufferedWriter(new FileWriter(temp));
Please help..
Thanks,

Edited by: ASH_2007 on Apr 14, 2009 6:28 AM
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on May 12 2009
Added on Apr 14 2009
7 comments
1,004 views