A Flash Developer Resource Site

Results 1 to 3 of 3

Thread: Dowload file?

  1. #1
    Member
    Join Date
    Aug 2009
    Posts
    44

    Question Dowload file?

    hello,
    Does anyone know how I can make a page to dowload a file?
    I am making a site to allow users to dowload web templates and was wondering if I can make a the usual dowload bow apear so the user can dowload a file that I will put on the server. Is this possible with AS3? If not how can I do it?

    Thanx in advance!
    MrSmither

  2. #2
    Senior Member joshstrike's Avatar
    Join Date
    Jan 2001
    Location
    Alhama de Granada, España
    Posts
    1,136
    You need to

    Code:
    import flash.net.navigateToURL;
    import flash.net.URLRequest;
    then when you want to download the file, create a URLRequest for the file you're trying to download...
    Code:
    var req:URLRequest = new URLRequest('http://www.somesite.com/myfile.pdf');
    then open it, with a new browser window.
    Code:
    navigateToURL(req,'_blank');
    Cheers,
    J

  3. #3
    Member
    Join Date
    Aug 2009
    Posts
    44
    wow thanx!!!
    so can i make it so that that url is only accesible from that line of code aka I don't want peapol to just type in the url to the address bar and download the file...
    Is that possible?

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