wood burning stoves 2.0*
The moose likes JSP and the fly likes How to connect UNIX server using Static Web page and download xls file. Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » JSP
Bookmark "How to connect UNIX server using Static Web page and download xls file." Watch "How to connect UNIX server using Static Web page and download xls file." New topic
Author

How to connect UNIX server using Static Web page and download xls file.

v arora
Greenhorn

Joined: Jan 14, 2013
Posts: 1
Hi,
I want
1.One Static page with hyperlink
2. this hyperlink will allow user to connect to some Unix server and access a report from a particular directory.
3. This should allow the user to download that file (xls) locally.
4. How can I authenticate user while connecting to this Unix server.

Kindly suggest..How to do that.
Stefan Evans
Bartender

Joined: Jul 06, 2005
Posts: 1017
- Make the hyperlink an ftp link to the file you need to download
- set up ftp on the unix server to authenticate the user.
- job done.

Joe Areeda
Ranch Hand

Joined: Apr 15, 2011
Posts: 310
    
    2

Stefan's method will certainly work. I tend to disable ftp on my servers for security reasons but that's also because I find I don't really need it bad enough to really lock it down to minimal access.

Pretty much any of the http security methods will work in this case I'd probably use basic auth as it's the easiest to set up. It's a bit different on different webservers but a google search for basic auth or htpasswd gives me lots of hits. You didn't mention which web server you are using so more details will probably just be confusing.

Assuming you don't have very many authenticated users either of these is fine but you have to set something up for each one.

Joe


It's not what your program can do, it's what your users do with the program.
Karthik Jayachandran
Ranch Hand

Joined: Feb 18, 2009
Posts: 88

Assuming the web-app is intend to run in LAN environ, you could create a JSP/servlet that would LIST all files in the mentioned folder of that server. Clicking the link could direct to a JSP/servlet which specifies
1. content-type,
2. sets header part (ie. filename),
3. Reads file and writes to the response (standard file writing while loop)
4. flush and close response
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: How to connect UNIX server using Static Web page and download xls file.