Granny's Programming Pearls
"inside of every large program is a small program struggling to get out"
The moose likes HTML, CSS and JavaScript and the fly likes JavaScript to SaveTarget Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Bookmark "JavaScript to SaveTarget" Watch "JavaScript to SaveTarget" New topic

JavaScript to SaveTarget

Kevin P Smith
Ranch Hand

Joined: Feb 18, 2005
Posts: 362
Hi guys, need a little help here.

I have a site where you can search through a number of files on a database.
Now I need somesort of download function where I can provide the URL and the user can download the file to thwir local machine.

I tries the SaveAs function but it just tries to save the whole page as an HTML. Is their any sort of SaveTargetAs function I can use?
Eric Pascarello

Joined: Nov 08, 2001
Posts: 15385
Why don;t you just say on the page (Right click on the link to save)

The SaveAs code you are using is probably IE only also.

Kevin P Smith
Ranch Hand

Joined: Feb 18, 2005
Posts: 362
Because I need to record each download so I know who downloaded what/when and my boss would never accept a "right-click here to save" option as a solution. He'll want a button/icon you click on which loads a save window where you select your Desktop/My Documents and lisk save/download
I agree. Here's the link:
subject: JavaScript to SaveTarget
It's not a secret anymore!