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 ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Jeanne Boyarsky
  • Tim Cooke
Sheriffs:
  • Liutauras Vilda
  • paul wheaton
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Frits Walraven
Bartenders:
  • Piet Souris
  • Himai Minh

regarding file creation on server -very urgent

 
Greenhorn
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 ");
}
else
{
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 = in.read()) != -1)
out.write(c);
in.close();
out.close();
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
https://www.kickstarter.com/projects/paulwheaton/free-heat
reply
    Bookmark Topic Watch Topic
  • New Topic