aspose file tools
The moose likes Sockets and Internet Protocols and the fly likes Problem in reading files in remote server Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of The Mikado Method this week in the Agile and other Processes forum!
JavaRanch » Java Forums » Java » Sockets and Internet Protocols
Reply Bookmark "Problem in reading files in remote server" Watch "Problem in reading files in remote server" New topic
Author

Problem in reading files in remote server

santhosh Dharmarajan
Greenhorn

Joined: Apr 13, 2005
Posts: 3
Hello All

This is regarding a query to read a file in a remote server.

The user interface is a html screen which contains 2 fields: Server ip & file name. Both are drop down fields.So they can select only the given file names & server names.

A servlet will recieve the data from the html.
The logic used is as below:
A URL is created with input given and using URLCOnnection i get the inputstream and read the data in the file. But i get an error, "file not found."
The url path formed looks like this
http://serverip/filepath/filename.

The file i am checking is in the home directory in the unix server.
Will the path given in the url check in the home directory. If not how to specify the path to the "home" directory in the url path.

Thanks
santhosh
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 35249
    
    7
A URL starting with "http" will only be understood by a web server. Are all the possible yservers you want to retrieve files from set up with a web server AND with a servlet/CGI that listens to URLs of the form you describe?
It sounds like you are trying to use HTTP as a sort of distributed file system, but that will only work with web servers and proper web apps that listen for file requests and return those files. Is using the filesystem directly (with mounts for the various servers) out of the question?
I would be very hesitant to serve files out of the root directory over HTTP for security reasons.


Android appsImageJ pluginsJava web charts
 
I agree. Here's the link: http://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to run our stuff on 16 servers instead of 3.
 
subject: Problem in reading files in remote server
 
Similar Threads
File upload into project structure
Commons FileUpload
problem displaying images from files in Firefox
Reading a file in a remote server
reading a file located on the server