SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    ********* wombat firepages's Avatar
    Join Date
    Jul 2000
    Location
    Perth Australia
    Posts
    1,717
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    OK I have done a few searches, here and at a few other places (including MS) and can not force a download in IE , MS themselves say that there is a bug in 4.01 , but for 5+ the following should work , it does in netscape!!!!!

    I have tried all sorts of things, yet in IE I always either,
    1)manage to download the file but without the filename being presereved, so 'any.gif' gets saved as 'download', the file is complete... just named incorrectly.
    or
    2)get the correct filename, ie a file called 'this.gif' appears on my desktop but id 0 bytes!.

    Anyway this is the code that works for NS but not for me (on several computers) in IE.
    <?
    header("Content-Type: application/octet-stream\n");
    header("Content-Disposition: attachment; filename=\"$file\"");
    ?>

    ($file holding the filename, I have tried with and without a path)


    please??? its driving me bonkers... quack quack dibble

  2. #2
    exit();
    Join Date
    Jul 2000
    Posts
    759
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hmm..A lot of people do this.

    You may be able to use JavaScript to do it however I don't know much of it..

    Did you try a meta redirect?

    Check out the source on download.com - I know they do it.

  3. #3
    SitePoint Evangelist
    Join Date
    Jul 2000
    Location
    Warwickshire, England
    Posts
    557
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Firepages, take a look at http://www.sitepointforums.com/showt...threadid=14284
    I think the answer for older browsers (as pointed out in the thread), is not using the content disposition, but making use of the apache feature that allows you to do file.php/somethingelse.ext/?download=something

    Otherwise, as Matt said, the answer lies in a meta redirect

    You shouldn't need a path in the content disposition btw


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •