wood burning stoves*
The moose likes JSP and the fly likes Does File Exist Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » JSP
Bookmark "Does File Exist" Watch "Does File Exist" New topic
Author

Does File Exist

Steve Dyke
Ranch Hand

Joined: Nov 16, 2004
Posts: 1393
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
Marshal

Joined: Mar 22, 2005
Posts: 41114
    
  45
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?


Ping & DNS - my free Android networking tools app
Steve Dyke
Ranch Hand

Joined: Nov 16, 2004
Posts: 1393
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
Marshal

Joined: Mar 22, 2005
Posts: 41114
    
  45
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

Joined: Jan 10, 2002
Posts: 60782
    
  65

Originally posted by Steve Dyke:
... using JSP code from the client side.


Clarification: JSP code runs on the server, not the client.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Does File Exist
 
Similar Threads
access ctrl exception in J2EE
connect with CGI
response.sendRedirect problem
Signle sign on without using Session Cookie
Upload file at shared location