dcsimg
A Flash Developer Resource Site

Page 1 of 2 12 LastLast
Results 1 to 20 of 22

Thread: °°°download link ;-)

  1. #1
    Senior Member -Attila-Berlin-'s Avatar
    Join Date
    Nov 2002
    Posts
    181

    °°°download link ;-)

    Hi,

    need a file-download-button in flash: How to?
    What actionscript do I need???

    Post Flashers

    Omitofo
    Attila

  2. #2
    FK'n_dog a_modified_dog's Avatar
    Join Date
    Apr 2003
    Location
    "aaarf"
    Posts
    9,176
    zip the file to be downloaded,
    action for a button -
    code:
    on(press){ getURL("the.zip"); }


  3. #3
    Senior Member -Attila-Berlin-'s Avatar
    Join Date
    Nov 2002
    Posts
    181
    ONLY ZIPFILES OR WHAT?

    what about videos and mp3s???

    Omitofo
    attila

  4. #4
    FK'n_dog a_modified_dog's Avatar
    Join Date
    Apr 2003
    Location
    "aaarf"
    Posts
    9,176
    mp3s and videos -
    you cannot guarantee ( on the users machine ) that media player or winamp will not try to intercept the download and play the file as it streams.
    afaik the only way to pop a download / save UI is to zip the file.

  5. #5
    Developer
    Join Date
    Sep 2001
    Location
    The Bluegrass State Will Flash For Food ™
    Posts
    3,789
    Heres how to do it in ColdFusion:

    To have the user download the file you can do something like this:

    myMovie.swf:
    code:
    mp3_btn.onRelease = function() {
    getURL("download.cfm?file=myMusic.mp3");
    }
    video_btn.onRelease = function() {
    getURL("download.cfm?file=myVideo.mov");
    }


    download.cfm:
    Code:
    <cfheader name="content-disposition" value="attachment; filename=#file#">
    <cfcontent file="#Expandpath(file)#" deletefile="no" type="application/unknown">
    Note; that is in ColdFusion. Using similar methods it can be done in asp, php, whatever...

  6. #6
    Senior Member -Attila-Berlin-'s Avatar
    Join Date
    Nov 2002
    Posts
    181
    Hey man,

    that was f.. unbelievable. So, I will try it in PHP - maybe it works

    Hey and gSolo_01, what about making some cool flash-fastfood?

    OMITOFO
    ATTILA

  7. #7
    Senior Member
    Join Date
    May 2000
    Posts
    172
    didn't work.

    anyone else have a way of allowing the .mp3's to be prompted to either OPEN or SAVE. The zip file just won't cut it. I'm STUCK!!!!
    Thanks,,,,,
    kicia

  8. #8
    Banned
    Join Date
    Apr 2001
    Location
    Montréal, Québec.
    Posts
    25,397
    Did you try gSolo's suggestion?

  9. #9
    Senior Member
    Join Date
    May 2000
    Posts
    172
    yes, nothing happened. copied and pasted everything there into my actions...didn't work
    ......grrrrrr.......

    but thanks for the help, don't know what i'm going to do now
    k

  10. #10
    Developer
    Join Date
    Sep 2001
    Location
    The Bluegrass State Will Flash For Food ™
    Posts
    3,789
    What application server are you using? PHP ASP ???

  11. #11
    Senior Member
    Join Date
    May 2000
    Posts
    172
    i use iPowerWeb.

    They say:
    CGI-BIN
    Perl Support
    MySQL
    PHP Support

    does that help???

    I guess at this point I'm looking for an example .fla [i use Flash5 still ]
    If only i could get 1 button that would allow the user to have the choice to either OPEN or SAVE the mp3 url when opened without zipping it.........ugh....

    Thanks much for all of your replys,
    kicia

  12. #12
    Developer
    Join Date
    Sep 2001
    Location
    The Bluegrass State Will Flash For Food ™
    Posts
    3,789
    For PHP - which I have no experience with - try this:
    PHP Code:
    $filename=basename($file);
    header("Content-Type: application/unknown");
    header("Content-Disposition: inline; filename=$filename");
    readfile($path); 
    Your link would be : download.php?file=myMusic.mp3

  13. #13
    Senior Member
    Join Date
    May 2000
    Posts
    172
    if i get this right, i should copy the php into a notepad file and rename it to download.php and put it in the same directory as my html and swf and put the download.php?file=myMusic.mp3 as my button properties??

    thanks for you continued attempt!
    kicia

  14. #14
    Senior Member
    Join Date
    May 2000
    Posts
    172
    it's just really hard to believe that a file such as an mp3 will not be prompted to OPEN or SAVE.
    ..still stuck...
    Anyone have any coding ideas??

    Thanks,
    kicia

  15. #15
    Hi

    was wondering if you managed to find a solution?

    I'm also having similar problems.

    I cannot believe that Flash cannot allow you to link to external files.

    What about Javascript?

  16. #16
    Senior Member
    Join Date
    May 2000
    Posts
    172

    Thank you!

    i don't know about javascript, nobody has assisted on this thread on a script for us. I just know that i definately do NOT want to use zip files,,,,,way to much work for the end user who is downloading mp3 files in my case or whatever you want them to downlaod.
    ....wish I had a remedy....would help my situation out a lot.
    Thanks to all very much who have replied to this thread!!! !!!!

    kicia

  17. #17
    I tried the download.php method and it worked but it doesn't work on a mac, it just downloads the download.php file to my desktop.

  18. #18
    Senior Member
    Join Date
    May 2000
    Posts
    172
    Hey Jakepeg,
    Could you post a copy of your ACTIONS you used with the php way?
    I'd like to see how I messed that one up. I would like to try it
    on my end.
    Thanks
    kicia

  19. #19
    maker of abstract sh*t
    Join Date
    Jul 2003
    Posts
    26
    hi, is this thread still active? what was the result of this? I have the same problem and am looking for a solution...
    cheers,

  20. #20
    maker of abstract sh*t
    Join Date
    Jul 2003
    Posts
    26
    i tried both the php and cfm ways,
    with exactly the geturl command mentioned, i even tried it straight from an html page with < a href="download.cfm?file='path to the file.mp3'>download< / a>
    in both cases (php and cfm), i juz get the contents of the php or cfm appear in my browser window!

    my host says it has:
    PERL, PHP4, Python, Ruby and TCL
    FrontPage 2002 Extensions
    Personal CGI-BIN
    Secure Socket Layer (SSL)
    Server Side Includes (SSI)

    any ideas?!

    cheers,

Posting Permissions

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




Click Here to Expand Forum to Full Width

HTML5 Development Center