Re: force download

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, August 10, 2005 2:07 pm, Sebastian wrote:
> if i don't use Content-disposition IE downloads the file as "unknown"
> (mp3, exe, or otherwise) with no extension and the names the file you
> are downloading becomes the name of the script that was called. lol?

So here's what you do.

Go ahead and RENAME your PHP script to "next_hit_song.mp3"

Then use .htaccess to tell Apache that it's *REALLY* a PHP script even
though it ends in .mp3

<Files next_hit_song.mp3>
  application/x-httpd-php
</Files>

That is what I mean by making the URL look "static"

IE is so [bleeping] stupid about URLs and content-type and rich media,
that you simply cannot give it any room for a mistake.

Consider the MP3s and m3u s on the pages here:
http://uncommonground.com/
http://uncommonground.com/artist_profile/Ellen+Rosner

Every one of the MP3/m3u files you can find there is really a PHP script.

They just happen to end in .mp3 and .m3u so IE can't [bleep] up.

The dynamic MP3 downloads (and streams) have the MP3 ID3 tags inserted at
download time, so the artists can correct typos or give me info like song
title and whatnot lonnnnnnng after the actual mp3 is created, identified,
and cataloged.

The m3u playlists are coming out the database from queries with all kinds
of "interesting" properties.

New playlist every day on the homepage.

Different playlist every download on the calendar pages:
http://uncommonground.com/events.htm

While you are there, check out that PDF.

Yup.

That ain't really a PDF, it's a PHP script.  But even IE can't manage to
screw up when the URL is http://uncommonground.com/events.pdf

I do need to fix the ones where the date (past/future months) is passed as
a GET argument.  Some versions of IE on the Mac mess that up.  Sigh.  In
my spare time.

-- 
Like Music?
http://l-i-e.com/artists.htm

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux