Solved

Downloading vs opening a file from a web site...

Posted on 2004-10-19
11
482 Views
Last Modified: 2013-12-24
I'm fairly new to web development, though I am an experienced programmer. I'm developing a web site using FrontPage. I have links to files in the web ... for example, I have a link to a Microsoft Office document. When you click on the link, the document opens. Instead, I would like the user to have the option to either open the file or download it. How do I do this? I can't figure it out and I've been through most of FrontPage help. I think it involves FTP, but whenever I search FrontPage help for ftp, I just get info about how to publish a web site. Thanks.
0
Comment
Question by:alicia1234
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 3
  • 2
  • +2
11 Comments
 
LVL 36

Expert Comment

by:Zyloch
ID: 12353008
Hi alicia1234,

Do you have a server-side language available? You can try setting content-type headers, for example, in PHP, you would have this:

//suppose you have word1.doc. Instead, make a link to word1.php that has this:

<?php
header('Content-type: application/msword');
header('Content-Disposition: attachment; filename="word1.doc"');
readfile('word1.doc');
?>

For Powerpoint, you would use

application/mspowerpoint (I believe)

Excel:

look for your extension, probably .xls in which case it's application/excel
check here: http://www.webmaster-toolkit.com/mime-types.shtml

Regards,
Zyloch
0
 

Author Comment

by:alicia1234
ID: 12353021
Sorry ... I don't understand any of what you've said here. I was hoping that there was some "feature" in FrontPage to do this, and I just hadn't discovered it yet. This web site is being published through a web-hosting service, so I don't "own" the web server.
0
 
LVL 36

Expert Comment

by:Zyloch
ID: 12353059
Does your webhosting service have a server-side language you can use? This method is only tricking the browser a bit. In the end, it's the browser's choice what to do with the file, this is just emphasizing that it's, let's say Word, and most browsers are set up to display Word documents in MSWord. I believe you can also set those same headers with <meta> tags but you can't include the word1.doc...
0
What Is Transaction Monitoring and who needs it?

Synthetic Transaction Monitoring that you need for the day to day, which ensures your business website keeps running optimally, and that there is no downtime to impact your customer experience.

 

Author Comment

by:alicia1234
ID: 12353157
I'm not sure if I want to get in to using a server-side language, even if one is available. But you do provide some insight in your answer ... sooooo ... it's actually the browser that figures out whether to open or download a file? But ... for instance ... when I go to the "AdAware" site and download their .exe setup file ... and I get a dialog box that asks if I want to "open" or "save" ... is that my browser doing that or their web site?
0
 
LVL 36

Expert Comment

by:Zyloch
ID: 12353205
Not sure about IE, but I do know for Mozilla Firefox, go to Tools->Options->Download->File Types. They're all there :)
0
 
LVL 29

Expert Comment

by:coreybryant
ID: 12353294
You can try to ZIP the file(s) in question & this will prompt the user to download the file(s)

-Corey
0
 
LVL 14

Expert Comment

by:hhammash
ID: 12355763
Hi,

If the files is supported by IE, like (xls, doc,ppt, pdf...etc):

1- Create a zipped copy of the same file
2- Create a popup windows when the user click the link
3- Give the user two options,  open or download
4- Link the "Open" option to the original uzipped file
5- Linke the "Download" option to the zipped copy of the file.

Regards
hhammash
0
 
LVL 14

Expert Comment

by:hhammash
ID: 12355764
Create a small popup using javascript
0
 
LVL 12

Accepted Solution

by:
rcmb earned 250 total points
ID: 12356905
Why not you make a small not beside or below the link that says to download this file
"right click on the hyperlink and select save target as"

It will then download the file.

RCMB
0
 

Author Comment

by:alicia1234
ID: 12358491
To rcmb ... thanks! So simple ... that's what I was looking for! (duh!) ;-)
0
 
LVL 12

Expert Comment

by:rcmb
ID: 12358565
Sometimes we all try to figure out all the ways to do something when the simple way was what you we really looking for.

Thanks for the points and glad to be of some help.

RCMB
0

Featured Post

The Ultimate Checklist to Optimize Your Website

Websites are getting bigger and complicated by the day. Video, images, custom fonts are all great for showcasing your product/service. But the price to pay in terms of reduced page load times and ultimately, decreased sales, can lead to some difficult decisions about what to cut.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

When setting up new project requests for our site, one of the most powerful tools our team has available to use is Axure (http://www.axure.com/). It’s a tool for creating software and web prototypes that can function and interact as if it were the a…
Introduction In this tutorial, I'll explain how to create an animated progress meter in a wireframe prototype developed using Axure RP 7.0 - a leading prototyping tool for designing web sites and software. (For more information about Axure and gett…
The purpose of this video is to demonstrate how to make a WordPress Site faster and smaller in size by cleaning up the database. This will be demonstrated using a Windows 8 PC. Plugin WP Optimize will be used. Go to your WordPress login page. T…
The purpose of this video is to demonstrate how to set up an RSS Feed on a WordPress Website. This will be demonstrated using a Windows 8 PC. Feedburner will be used for this demonstration. Go to your WordPress login page. This will look like the…

728 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question