• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Does File Exist

 
Steve Dyke
Ranch Hand
Posts: 1619
1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
How can I check to see if a network file exists using JSP code from the client side. If I run on my local web host server the File class works to find a file using the unc path but when I deploy it to the production web server the file cannot be found.
 
Ulf Dittmer
Rancher
Posts: 42967
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Where does this "network file" exist - on the client where the browser runs, on the server where the web app runs, or on some other machine?
 
Steve Dyke
Ranch Hand
Posts: 1619
1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It is located on a network machine different from the Web Server.

I think I might have found another solution at least partly. Instead of the File class I am using the URL Class except I cannot figure out how to tell if the URL does not return as valid. How can i test the URL to know wheather or not to process other code on my JSP?
 
Ulf Dittmer
Rancher
Posts: 42967
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Using the File class should work, unless that machine has a different type of file system, e.g. SMB - is that the case?
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64716
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Steve Dyke:
... using JSP code from the client side.


Clarification: JSP code runs on the server, not the client.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic