There's no such thing as a stupid question, but they're the easiest to answer.
JoinTour
Login
 
Tag Cloud
access audio avg avg 8 bios blue screen boot bsod computer connection cpu crash css dell desktop dma driver drivers dvd email error excel explorer firefox firefox 3 freeze gimp graphics hard drive hardware hijackthis hjt install internet internet explorer itunes keyboard laptop macro malware monitor motherboard network networking outlook outlook 2003 outlook 2007 outlook express pio problem problems router seo server slow sound sp3 spyware trojan usb video virtumonde virus vista vundo windows windows vista windows xp winxp wireless
Web Design & Development
Search
Search in:
 
Advanced Search
Tech Support Guy Forums > Internet & Networking > Web Design & Development >
Solved: File Downloads


HELLO AND WELCOME! Before you can post your question, you'll have to register -- it's completely free! Click here to join today! We highly recommend that you print a copy of our Guide for New Members. Enjoy!

 
Thread Tools
coachdan32's Avatar
Computer Specs
Senior Member with 1,000 posts.
 
Join Date: Nov 2003
Location: Louisville, KY
07-Mar-2005, 09:55 AM #1
Question Solved: File Downloads
What is invloved in setting a page up that will allow a visitor to download a file from your site? I will be just a simple .doc, .xls, or .mdb file.
rankbeginner's Avatar
Member with 75 posts.
 
Join Date: Jun 2004
Experience: Beginner to Programming
07-Mar-2005, 12:40 PM #2
1) Upload the file to your web space: let's say it's named football.doc
2) Know the full pathname of the file: which might be http://www.yoursitename.com/football.doc
3) on a web page, make a link to that file like this:
<a href="http://www.yoursitename.com/football.doc">Download the file football.doc</a>

That should do it. When the user clicks on the file it will download. ... You might want to zip the file first -- compress it -- and then put up that zipped file for downloading. That saves time for your downloaders, and saves bandwidth space (and possibly cost) for you.
coachdan32's Avatar
Computer Specs
Senior Member with 1,000 posts.
 
Join Date: Nov 2003
Location: Louisville, KY
07-Mar-2005, 01:44 PM #3
Thanks. I will give it a go.
coachdan32's Avatar
Computer Specs
Senior Member with 1,000 posts.
 
Join Date: Nov 2003
Location: Louisville, KY
20-Mar-2005, 08:50 PM #4
I tried this, but all that happened was it opened the document in my browser window. I am wanting it to pop up a file download dialog box so they can download it to their hard-drive. How do I set that up?
coachdan32's Avatar
Computer Specs
Senior Member with 1,000 posts.
 
Join Date: Nov 2003
Location: Louisville, KY
21-Mar-2005, 02:28 PM #5
bump
Gibble's Avatar
Distinguished Member with 27,137 posts.
 
Join Date: Oct 2001
Location: Striking or Scoring
Experience: The Alpha and Omega
21-Mar-2005, 02:34 PM #6
Quote:
Originally Posted by coachdan32
I tried this, but all that happened was it opened the document in my browser window. I am wanting it to pop up a file download dialog box so they can download it to their hard-drive. How do I set that up?
All they have to do is right click on the link and select "save link as"
coachdan32's Avatar
Computer Specs
Senior Member with 1,000 posts.
 
Join Date: Nov 2003
Location: Louisville, KY
21-Mar-2005, 02:43 PM #7
You know that and I know that, but the visitors for my site are pretty novice computer-users and I am trying to keep from having to take up space on the page to put directions for download. Surely there is another way.
Gibble's Avatar
Distinguished Member with 27,137 posts.
 
Join Date: Oct 2001
Location: Striking or Scoring
Experience: The Alpha and Omega
21-Mar-2005, 02:49 PM #8
You can edit the .htaccess file (or create it if it doesn't exist) to tell the webserver, to not tell the browser what type of file it is being sent, this 'should' make the save as dialog appear.

Create a file called ".htaccess" with the following lines
PHP Code:
<FilesMatch "\.(doc)$" >
 
ForceType application/octet-stream
 
</FilesMatch
This should make the save as dialog appear for all doc files
__________________
izme: You know...it's kind of nice to sit atop Civilized debate and look down below on all of the uncivilized master debating we are here...just out of the fight zone

Gibble: Now you know what it's like to be Canadian.
coachdan32's Avatar
Computer Specs
Senior Member with 1,000 posts.
 
Join Date: Nov 2003
Location: Louisville, KY
21-Mar-2005, 09:39 PM #9
Let me make sure I understand. Create a file with the above code (in Notepad?) and name it .htaccess. When I do that it wants to add .txt to it and if I delete the extension it added, it turns to that unrecognized Windows file logo. So exactly how should I do it? I know nothing about PHP (I use ASP/vbscript) and will it work in the ASP/vbscript world? That is exactly what I want to do though.
__________________
CoachDan
http://www.malehsbaseball.com

Gateway Pentium 4 3.0 GHz
200G Sata HD
800 FSB
512 DDR
DVD +-R/W
XP Home
Gibble's Avatar
Distinguished Member with 27,137 posts.
 
Join Date: Oct 2001
Location: Striking or Scoring
Experience: The Alpha and Omega
22-Mar-2005, 03:58 AM #10
Yep, exactly that, if your webhost supports .htaccess files
(it may, or may not...depending on where your site is hosted.)

Where is your site hosted? I can check if you'd like.
coachdan32's Avatar
Computer Specs
Senior Member with 1,000 posts.
 
Join Date: Nov 2003
Location: Louisville, KY
22-Mar-2005, 09:07 AM #11
It is through a host named Robowebsites, but I believe the sites actually sit on webhosting4life's servers.
Gibble's Avatar
Distinguished Member with 27,137 posts.
 
Join Date: Oct 2001
Location: Striking or Scoring
Experience: The Alpha and Omega
22-Mar-2005, 09:43 AM #12
Then it more than likely supports .htaccess files.

You should be good to go with what I suggested.
coachdan32's Avatar
Computer Specs
Senior Member with 1,000 posts.
 
Join Date: Nov 2003
Location: Louisville, KY
22-Mar-2005, 09:55 AM #13
Thanks, I'll give a shot tonight and post back with results.
Rockn's Avatar
Computer Specs
Distinguished Member with 17,888 posts.
 
Join Date: Jul 2001
Location: Mexico of the North, MN
Experience: Disenfranchised American Male
22-Mar-2005, 04:08 PM #14
IIS doesn't support .htaccess
There is a free utility for IIS that does most of the same stuff the .htaccess file does.
http://www.iistoolshed.com/
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are Off
Refbacks are Off

You Are Using:
Server ID
Advertisements do not imply our endorsement of that product or service.
All times are GMT -4. The time now is 02:25 AM.
Copyright © 1996 - 2008 TechGuy, Inc. All rights reserved.
Powered by vBulletin, Copyright © 2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.1.0
Powered by Cermak Technologies, Inc.