Last week, we had the author of TDD for a Shopping Website LiveProject. Friday at 11am Ranch time, Steven Solomon will be hosting a live TDD session just for us. See for the agenda and registration link
  • 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 ...
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Jeanne Boyarsky
  • Tim Cooke
  • Liutauras Vilda
  • paul wheaton
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Frits Walraven
  • Piet Souris
  • Himai Minh

regarding file creation on server -very urgent

Posts: 23
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hi all
Im using apache tomcat 4.1 server how can i create a folder at server and copy the file in that folder if the client uploads the file. i have tested my code on my own system where client and server are on the same machine the code is

String path= "c:\program files\apache tomcat 4.1\webapps\jetspeed\technologies";
//im creating the folders by the following code here directory=ejb\20 or jsp\21 or any combinations
//(i:e technology\number)

if((new File(path+"\\"+directory).exists()))
System.out.println("Directory already exists ");
System.out.println("does not exists ");
new File(path+"\\"+directory).mkdir();
path = path + directory + somefile.txt
File outputFile = new File(path);
FileReader in = new FileReader(inputFile);
FileWriter out = new FileWriter(outputFile);
int c;
while ((c = != -1)
this code is properly working in my system (client and server both are on the same machine) but when the client is on the different machine this code may not work, so what should i do so that i get the same functionality what i got when the server and the client are on the same system.
please put a code which could be usefule to me
thanks in advance
A wop bop a lu bob a womp bam boom. Tutti frutti ad:
Free, earth friendly heat - from the CodeRanch trailboss
    Bookmark Topic Watch Topic
  • New Topic