• 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
  • Tim Cooke
  • Liutauras Vilda
  • Jeanne Boyarsky
  • paul wheaton
Sheriffs:
  • Ron McLeod
  • Devaka Cooray
  • Henry Wong
Saloon Keepers:
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Tim Moores
  • Mikalai Zaikin
Bartenders:
  • Frits Walraven

how to create a file on server.

 
Greenhorn
Posts: 25
Hibernate Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Ranch Hand
Posts: 256
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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 Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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 !!
 
Ranch Hand
Posts: 174
Java ME Opera Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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 Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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 ME Opera Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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 Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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 !!
 
You have to be odd to be #1 - Seuss. An odd little ad:
Gift giving made easy with the permaculture playing cards
https://coderanch.com/t/777758/Gift-giving-easy-permaculture-playing
reply
    Bookmark Topic Watch Topic
  • New Topic