Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Option to View and Save the same file

Status
Not open for further replies.

xenology

Programmer
May 22, 2002
51
US
I have some pdf and xls files that I will post to my intranet. I want to give the user two buttons for each file. One button would display the popup Save As window so the user can download the file and the other button would display the file in the browser window. What's the easiest way to accomplis this?
thx!
-xeno
 
As far as I know, the best way of doing this is to simply link them!

Code:
<a href="spreadsheetfile.xls">Spreadsheet</a>
<a href="adobeacrobatfile.pdf">PDF</a>

For the spreadsheet, once the user clicks on the link, they are given the option to open, save or cancel.

For the pdf, the file opens, and the user can then save.

[cheers]
Cheers!
Laura
 
You are close to getting what I need...

3 column table. 1 column is document description. 2 columns is button to download that file. 3 column is button to view the file...


======================================================
| 1st Quarter Funding.xls | Download | View |
------------------------------------------------------
| 2nd Quarter Funding.xls | Download | View |
------------------------------------------------------
| Projected Results.pdf | Download | View |
======================================================

See what I mean?
 
View will depend if user has the appropriate viewers installed. If not, the file will download anyway. You cannot force download with html but you can do it with server side scripting, if you have one available. Look at this thread for a good solution.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top