Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie

download, don't open

Options
  • 08-06-2006 3:09pm
    #1
    Registered Users Posts: 8,488 ✭✭✭


    I need a link that forces the 'save as' dialog for a file which would usually load in the browser window. Anyone know how this is done?


Comments

  • Closed Accounts Posts: 6,131 ✭✭✭subway


    seems do able with asp
    not with html

    have a read of this,
    lots of guides on google too

    http://www.aspfaq.com/show.asp?id=2161


  • Registered Users Posts: 8,488 ✭✭✭Goodshape


    Cheers, though I should have specified I'd much prefer something in PHP.

    I think the PHP header function might do the trick.


  • Closed Accounts Posts: 6,131 ✭✭✭subway


    found this to,
    might make sense to you as you php -

    <?php
    header("Content-type: application/x-unknown");
    header("Content-Disposition: attachment;
    filename=proposedFileName.wav");
    readfile('test.wav');
    ?>


    "Content-type: application/x-unknown seems to be the imporatan but as it tells the browser that even though it recognises the extension, it doesnt know what to do with it


  • Closed Accounts Posts: 7,563 ✭✭✭leeroybrown


    As pointed out it's not possibly using HTML alone but it realatively easy to script a streamed download that will use header functions with 'Content-Type' and 'Content-Disposition'.

    If you are dealing with a particularly large file be careful how you implement it as there can be a large memory overhead (and a delay) in providing streamed downloads where the entire file is read in first and then streamed out.


  • Registered Users Posts: 3,514 ✭✭✭Rollo Tamasi


    there was a thread on this in the programming forum a while back.


  • Advertisement
  • Registered Users Posts: 597 ✭✭✭yeraulone


    zip it.


  • Registered Users Posts: 8,488 ✭✭✭Goodshape


    yeraulone wrote:
    zip it.
    Not really on option I'm afraid.
    If you are dealing with a particularly large file be careful how you implement it as there can be a large memory overhead (and a delay) in providing streamed downloads where the entire file is read in first and then streamed out.
    Hmm.. I've got potentially quite big files alright :-/

    Cheers for all the replys anway.. should be able to sort something out.


Advertisement