This week's book giveaway is in the Other Languages forum.
We're giving away four copies of Functional Reactive Programming and have Stephen Blackheath and Anthony Jones on-line!
See this thread for details.
Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

how to create a file on server.

 
satnam singh negi
Greenhorn
Posts: 25
Hibernate Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all,

please help me to create a file on server, i want to create a directory above the web-inf and then want to generate a file inside it.



I am trying this and i am able to go the place where i want to but, No file is getting generated.

Please suggest.


Thanks in Advance.
 
bhanu chowdary
Ranch Hand
Posts: 256
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Satnam,
How are you generating the file? Please put the code here.
 
satnam singh negi
Greenhorn
Posts: 25
Hibernate Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
bhanu chowdary wrote:Hi Satnam,
How are you generating the file? Please put the code here.






This should create a file in my workspace,in somefolder under webcontent.but not working.

any other approach will appreciable.

Thanks !!
 
Zandis Murāns
Ranch Hand
Posts: 174
Java Java ME Opera
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I belive this does not works because "somefolder" does not exists or test.txt exists already.
Have a try:
 
satnam singh negi
Greenhorn
Posts: 25
Hibernate Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Zandis Murāns wrote:I belive this does not works because "somefolder" does not exists or test.txt exists already.
Have a try:




That is a great help....and it says file already exists..but i can't find it in the folder. where it has been created already ?
Thanks
 
Zandis Murāns
Ranch Hand
Posts: 174
Java Java ME Opera
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You are seeing full path to the file in that output message.
If you're not seeing such file in you'r file explorer, perhaps it's hidden or somehow invisible to the user. Copy full path of that file, run notepad or other you'r text editor and click open -> paste copied path -> return key press.
 
satnam singh negi
Greenhorn
Posts: 25
Hibernate Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Zandis Murāns wrote:You are seeing full path to the file in that output message.
If you're not seeing such file in you'r file explorer, perhaps it's hidden or somehow invisible to the user. Copy full path of that file, run notepad or other you'r text editor and click open -> paste copied path -> return key press.




Absolutely , you are correct !! i did that thing and an notepad turns into a .txt file ,it show the name of file. but why it is happening like

that..what do i need to do if i want to create a file on my workspace, e.g like relative to web-inf or anywhere in workspace.


Please Suggest.

Thanks !!
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic