Solved

Making a file available for downloading

Posted on 1997-04-22
2
153 Views
Last Modified: 2013-12-25
I'm creating some forms (expense report, entertainment
approval, etc.) for the guys here at work. I want to
be able to put the names of the forms in our website
and have the guys just click on the name and the file
automatically downloads. I am using Netscape Gold 3.01.

We don't have an "FTP" site that can be accessed using
this method. I used the "a href" HTTP code and then I
went to Options-General-Helpers and added the suffix
"zip" and told it to "save to disk" whenever a file
ending in "zip" was clicked on. When I did that and I
clicked on the "zip" file, it took me to another web
page with a bunch of weird characters in it. I changed
the suffix to "xls" (it's an Excel file) and it did the
same thing with the same result.

What can I do to make this file downloadable so when the
person clicks on the file name, it will come back with
a "Save As" dialog box and prompt the user to save the
file to his disk.

Thanks,
Teri
0
Comment
Question by:teriking
2 Comments
 
LVL 4

Accepted Solution

by:
jshamlin earned 100 total points
ID: 1854115
The techniques you've used **should** work  - i.e. <A HREF="filename.zip">filename</A> should cause a user to be prompted to save the file to disk.

HOWEVER, your IPP (the company hosting your http server space) may have configured the MIME types to serve .zip or .xls or other file types diretly to the Web browser as text files.

And so, your "fix' would be to get in touch with your ISP and ask about the MIME configuration - explain what you're trying to do.

Problem is, the IPP might not be willing to configure its servers properly - by over-riding the ability to serve various file types, an IPP can coerce its users into buying FTP space - pretty shady practice. Or, if you want to imagine more honorable motives, an IPP may have configured its servers NOT to serve files of those kinds because they consume an inordinate amount of bandwidth - and how'd you like to be hosted on the same server as Zippy's Free game site, with freeloaders hogging the bandwidth to download files, which makes your Web pages inaccessible?

If your IPP won't correct their MIME configurations, you may need to switch to another IPP - you can get a pretty good deal on Web space these days (about 25 MB with your own domain names for about $300.00/an).  You'll still need a separate *access* account, but you'll have better control over your Web site (not to mention a broader array of services).

- S



0
 

Author Comment

by:teriking
ID: 1854116
I checked with my System Administrator, and she needs to get
the "exact" add-type line to be added, in order for it to
work (I have no idea what that means, personally). I received
another reply (from a newsgroup):

The suffix rules are only used if the server sends no Content-type, or a file is opened from disk. In order to get a download to disk, you will need to configure your server to send the appropriate content type and/or encoding (usually an AddType directive in the configuration file).

My SysAdmin's response to that is as follows:

That message doesn't make any real sense to me, however if you can get an EXACT add-type line that can be added, and the exact config file name (there are 4 config files for ncsa httpd)
I would be happy to add it for you. The only use for addtype lines that I know of is for server side includes, in the
srm.conf file, which i don't think is related.

Does this make sense, and is it do-able?

Thanks!
Teri
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Joomla Website Malfunction 9 93
PHP extract HTML using DOMXpath from nested tables 8 49
How can I split the array as 4 rows per line? 5 81
WEB Farm 6 64
Read about why website design really matters in today's demanding market.
Password hashing is better than message digests or encryption, and you should be using it instead of message digests or encryption.  Find out why and how in this article, which supplements the original article on PHP Client Registration, Login, Logo…
Viewers will get an overview of the benefits and risks of using Bitcoin to accept payments. What Bitcoin is: Legality: Risks: Benefits: Which businesses are best suited?: Other things you should know: How to get started:
The is a quite short video tutorial. In this video, I'm going to show you how to create self-host WordPress blog with free hosting service.

896 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

Need Help in Real-Time?

Connect with top rated Experts

14 Experts available now in Live!

Get 1:1 Help Now