• Post Reply Bookmark Topic Watch Topic
  • New Topic

application.getRealPath("/") function  RSS feed

 
gaser hasan
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Please Could I would like to know why this method doesn't work on the server while it is working on my local server
i am using NetBeans

 
Nilesh Miskin
Ranch Hand
Posts: 44
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
May be that's because there are situations wherein the getRealPath returns null such as where the servlet container can't determine a valid file path for this method such as when the web application is executed from an archive, on a remote file system not accessible locally.
 
gaser hasan
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
May be but i tried to print the value of the method in the same page and it shown me the path
but i tried to change the path as follow (../the file name )

but it doesn't work
 
Nilesh Miskin
Ranch Hand
Posts: 44
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Then it looks like the problem is not with getRealPath() method; but with the logic of setFolderstore() method.
 
gaser hasan
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
so far i have tried more than one example to upload to the server but in vain if there
any example implemented i will be grateful

thanks
 
David Newton
Author
Rancher
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
We have no idea how you're trying to upload the file (or why it's being done in a JSP), so it's impossible to help. Please TellTheDetails.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!