manojtyagi
January 24th, 2005, 11:41 AM
hi all
can i get the file names on web server by making ftp connection in java?
if yes,please tell me the steps.
Davey
January 24th, 2005, 04:13 PM
Probably not, it depends on your set up. A HTTP Server is different to a FTP server and they don't have to point to the same directories on the server.
cjard
January 24th, 2005, 06:55 PM
as davey suggests, this depends entirely on the setup of the web server. you really need to tell us more information about it..
is this a website hosting space that you buy off a company? do they give you ftp access to the files?
my company's webhost gives us ftp access, and it's real simple. the computer at the end of www.lexpos.com domain name runs a web server and an ftp server. i dont much care how winsave.com choose to organise their filesystems, but i do know that when i log in to www.lexpos.com's ftp server, and do a LIST, i see all the files as they appear on the web
so if theres a file /somedir/somefile.html then its url is www.lexpos.com/somedir/somefile.html
it is not guaranteed to be this way.. example, when ypu log in you might see a PUB directory, and in there is a WWWROOT directory, and in there, THAT's what goes in the website addresses.
end of the day, the answer to your question is YES, you can use ftp to list the files that a webserver can serve, BUT only if:
1) the company with the webserver expose an ftp server for you to use
2) you have an account on that ftp server
3) you can figure out the relation between the directory structure you see on the ftp server and the URL structure you type into a web browser