File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Servlets and the fly likes File Upload Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "File Upload" Watch "File Upload" New topic

File Upload

ford Darcy Jr
Ranch Hand

Joined: Jan 26, 2005
Posts: 76

I am using multipartrequest for fileupload in servlets. I want to save the file with the new filename on the server. But its getting saved with the original filename. Is there anyway to save the file with a new filename ?

Akbar Basha R

Joined: Mar 11, 2002
Posts: 23
Upload the file with the original file name and then use the File Class and the renameTo method to change the file name to a new one.
Don't get me started about those stupid light bulbs.
subject: File Upload
Similar Threads
File field content
JfileChooser selecting existing file.......?
Saving runtime Swing UI as image
saving an image
Export to excel question