aspose file tools*
The moose likes HTML, CSS and JavaScript and the fly likes program button to perform FTP Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Bookmark "program button to perform FTP" Watch "program button to perform FTP" New topic
Author

program button to perform FTP

Robert Lanois
Greenhorn

Joined: Dec 25, 2005
Posts: 6
I am trying to figure out how to program a button on my web site to when clicked it opens a dialog to download a file to the users PC. What is the easiest way to code the button?

Bob
uj johansson
Greenhorn

Joined: Dec 31, 2005
Posts: 23
What do you have so far?
Robert Lanois
Greenhorn

Joined: Dec 25, 2005
Posts: 6
As for java coding I have nothing. I am ok with working HTML but here is what I have done. I can link to the file in this case it is a pdf. The file opens immediatly and that is ok. But what I am looking to do is to have a link for just file save for the user from my web page. It is a catalog that I want available for the user of the site. I can because I understand computers easily right mouse on the link and use the save target option. This is not how I want people to have access to the file. What I am looking for is a better option.
Robert Lanois
Greenhorn

Joined: Dec 25, 2005
Posts: 6
I think my best bet is to zip or compress the catalog into a zip file. There are more than one page to the catalog and each page is a pdf so I think that is my best option, at least for now.

Thanks

Bob
Ernest Friedman-Hill
author and iconoclast
Marshal

Joined: Jul 08, 2003
Posts: 24187
    
  34

The thing that matters is the MIME type that the server uses to send the file; this generally depends only on the filename, but a server can generally be configured for special cases.

In any case, this has nothing at all to do with Java; it's an HTML/HTTP question. I'm therefore going to move it to our HTML and JavaScript forum, where the conversation can continue in a more appropriate venue.


[Jess in Action][AskingGoodQuestions]
Paul Clapham
Bartender

Joined: Oct 14, 2005
Posts: 18657
    
    8

With a link you would just make its href be the full FTP URL. I would try adapting that to a button in one of the standard ways. Or just use a link.
Robert Lanois
Greenhorn

Joined: Dec 25, 2005
Posts: 6
Originally posted by Paul Clapham:
With a link you would just make its href be the full FTP URL. I would try adapting that to a button in one of the standard ways. Or just use a link.


Maybe it cannot be done to an Adobe "PDF" file because when I put the href for the file on the server it opens the file as opposed to giving the option to save to disk. It does not matter what I found was that if I put that file up it took too much of my server space anyway. I have since changed my thoughts on that file availability. One way that it did work however was if the file was zipped. Even zipped the pdf was way too big. It is a catalog for my company's products with graphics. I am thinking that I need to revamp the pages into something a bit smaller in the byte scale. Thanks for the information.
 
wood burning stoves
 
subject: program button to perform FTP