Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Uploading files at server  RSS feed

 
Prakash Dwivedi
Ranch Hand
Posts: 452
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have to develop a website where user can upload their html page. This webpage i have to save on server. For every user i have to create a folder with the name of his userid. Now my problem is, to create a folder i must know the absolute path of my jsp page(which is not possible). How can i create a folder in the folder in which my jsp page exist.

thanx
 
RAJESH RASTOGI
Greenhorn
Posts: 17
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
u can get the real path on the server of the jsp file by using
application.getRealPath("jspfilename.jsp");
now u have the path of ur jsp file, now u can create the folder n upload the html files.
 
Prakash Dwivedi
Ranch Hand
Posts: 452
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks rajesh, this is exactly what i was looking for
 
Consider Paul's rocket mass heater.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!