Community Forums

Important Notice:

Two sections of this forum are available only to registered customers. In order to receive access to the Customer Forums and ResellerCentral Forums, you must first register on these forums or login to your existing forum account. If you are an existing HostNine customer, be sure to register using the email address on file for your billing profile.

Go Back   HostNine Community Forums > H9 General Forums > Lounge / Off Topic > Web Hosting

Notices

Reply
 
Thread Tools Display Modes
  #1  
Old 08-01-2007, 01:11 PM
beholder beholder is offline
Junior Guru Wannabe
 
Join Date: Nov 2006
Posts: 90
Question Is there a way to Force the download of a file?

Is there a easy way to immediately prompt the user to save the file directly to the user's disk, without opening it in the browser?
Reply With Quote
  #2  
Old 08-01-2007, 01:27 PM
LeeUmm LeeUmm is offline
Junior Guru Wannabe
 
Join Date: Nov 2006
Posts: 94
Default

Hi,

Add this to your .htaccess file

AddType application/x-unknown mp3

Change mp3 to whatever file extension you're after. This will force a download prompt on all files with that extension though. Not sure of any easy way to do just a few files. Not even sure that's possible.
Reply With Quote
  #3  
Old 08-01-2007, 01:31 PM
beholder beholder is offline
Junior Guru Wannabe
 
Join Date: Nov 2006
Posts: 90
Default

That only seems to work with firefox not IE...any other ideas?
Reply With Quote
  #4  
Old 08-01-2007, 01:32 PM
H9Travis's Avatar
H9Travis H9Travis is offline
ResellerCentral Developer
 
Join Date: Apr 2007
Posts: 159
Default

Hi,

It depends on the type of file as most common files have what are called MIME types, which basically specify the type of file and how to handle it. For instance .html files are handled by the browser, .pdf's open with adobe reader, etc...

The best way to just directly download a file is to right click the hyperlink and say 'Save file as...'
__________________
Travis Brown
HostNine Transfers Admin
HostNine Reseller Central Development Team
Reply With Quote
  #5  
Old 08-01-2007, 01:39 PM
LeeUmm LeeUmm is offline
Junior Guru Wannabe
 
Join Date: Nov 2006
Posts: 94
Default

Weird. This works in IE on my computer, as well as my friend's who tested for me. I've checked in IE7 and 6.
Reply With Quote
  #6  
Old 08-01-2007, 01:59 PM
McCarthySites McCarthySites is offline
Web Hosting Guru
 
Join Date: Jun 2007
Posts: 291
Default

Found this:

http://www.thescripts.com/forum/thread4011.html

Brian
Reply With Quote
  #7  
Old 08-01-2007, 03:55 PM
beholder beholder is offline
Junior Guru Wannabe
 
Join Date: Nov 2006
Posts: 90
Red face

Found this link:

http://elouai.com/force-download.php

works well
Thanks for all your help
Reply With Quote
Reply

Thread Tools
Display Modes

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

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
change config php file neprinting Web Hosting 1 07-07-2009 02:28 PM
can not upload file more than 200KB medinipur Shared Web Hosting 0 04-19-2009 12:06 PM
Allow visitors to download content lonestar Site Builder 5 09-07-2008 12:18 PM
Upload File php script munchie Web Development 2 05-01-2007 08:37 AM


All times are GMT -5. The time now is 08:04 PM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.

Host Nine

Our mission began in 2006. Thousands of awesome clients later, we are now one of the most popular hosters in the world.
Most of this is because of our fantastic support. Join us, you'll be glad you did - that's a given.