Flash Advisor logo
:: Desktop Shortcut
:: Flash Help
Advice from Experts

Closed Thread
Results 1 to 3 of 3

Thread: Help please

  1. #1

    Default Help please

    Hi, Iīm doing a website for my band, and we would like to have our music downloadabel on our website, but I really canīt figure ut how to make it possible! Have tried getURL and then the filen name for example myfriend.mp3 but it donīt work!

    Iīm very gratefull if anyone could help med out whit this!

    Thanks!

    Calle

  2. # ADS
    Join Date
    Always
    Posts
    Many
     
  3. #2
    Join Date
    May 2004
    Location
    U.S.A.
    Posts
    2,890

    Default

    Hi,

    The easiest way to make a file downloadable is to put it in .zip format. Any zip file encountered by a browser will automatically prompt a download manager. If you have access to a server side scripting language (eg PHP) you can also use that to handle the download of a file (and make sure you get a save dialog, instead of the browser opening the file directly). when the server sends a file to the browser it is sent with a file type the browser uses this to determine what it should do with it, eg if the file type tells the browser it is opening a pdf file it can call up acrobat reader to open the file directly.

    PHP can be used to modify the http headers so the file is sent with the content type application/octet-stream (a sort of general purpose type) instead of its normal file type. because the browser doesn't know what to do with a file of this type it simply prompts for the user to save it,

    to do this you can create a php script like this,



    Code:
     
    <?php 
    // download.php 
    // retrieve the filename to download from the query string of the page 
    $file = $_GET&#91;'filename'&#93;; 
    // send the headers 
    header&#40;"Content-type&#58; application/octet-stream"&#41;; 
    header&#40;"Content-disposition&#58; attachment; filename=$file"&#41;; 
    // and output the contents of the file 
    readfile&#40;$file&#41;; 
    ?>


    now to download a file you could call the PHP script with getURL,
    Code:
    getURL&#40;"download.php?filename=documentfilename.pdf"&#41;;
    A mind once stretched by a new idea never regains its original dimensions.
    - Oliver Wendell Holmes

  4. #3

    Default

    Thank you very much! Iīll try this as soon as i have opertunity! Now we maybe be able to release our site in time for once =)

    Thanks once again!!!

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

     

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
Sponsors
Create Speaking Characters for your website and Flash movies. 15 Day Free Trial