• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Runtime Folder Creation

 
Ranch Hand
Posts: 357
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi
All
In my applications i used file upload facility.Im able to upload file.But i want to save that file into web=-server.Now my problmes is for each user i want to creat runtime folder .I mean when user register himself that time a folder is also created with his/her user name .So when i upload servlet i can store that file into that folder.
Thanking in Advance
sanjay
 
Saloon Keeper
Posts: 27762
196
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
1. Create a java.io.File object initialized to the path name for the directory (including the directory name itself). That is:
java.io.File myDir = new java.io.File("C:/webserver/users/fred");
(If you prefer the backslashes, don't forget to escape them!)
2. Do the following:
myDir.mkdir();
3. Wrap suitable exception handling around the above to catch cases where the directory couldn't be created, such as a full disk or wrong access rights.
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic