A Flash Developer Resource Site

Results 1 to 7 of 7

Thread: open a save file dialog box from a button?

  1. #1
    Junior Member
    Join Date
    Dec 2003
    Posts
    3

    open a save file dialog box from a button?

    Hello,

    I want to allow users to download files linked to via buttons in my flash movie.

    Currently I'm using getURL to open the file up and relying on the user's browser to display the file and allow them to save it.

    What I'd like to do is have a button that brings up a standard dialog box for saving the file (like what you'd get with a right click "save as" in windows).

    Is this possible with flash? I'm still using FlashMX if it makes a difference.

    All of my searches on this topic have been fairly futile and ridden with results about how to download tutorial files or whatever, heh.

    Thanks in advance for any help!
    Last edited by starPause; 12-17-2003 at 02:41 PM.

  2. #2
    Member
    Join Date
    Dec 2003
    Posts
    58
    Hi there,

    Listen to yourself: You want to override the operating system's save-dialogs, replace them with your own and save data on the users system. If that were possible, Flash-movies could install virii, backdoors and god knows what.

    pecoes

  3. #3
    Junior Member
    Join Date
    Dec 2003
    Posts
    3
    heh, peceos, don't get too excited!

    I said i want to bring up a standard dialog box--which, in my searching around, i've found is possible, I'm just not sure how.

    Like the download button on this guy's page (unfortunatly the download button isn't part of any of his examples, so i've emailed him but no response yet)

    Do you see what I want?
    Last edited by starPause; 12-17-2003 at 12:40 PM.

  4. #4
    Member
    Join Date
    Dec 2003
    Posts
    58
    I see, but that's something simple, like:

    getURL("sample.zip");

    The standard dialogs aren't part of Flash in any way.

  5. #5
    Junior Member
    Join Date
    Dec 2002
    Posts
    29
    Quick question regarding this: how do websites that allow you to upload/save images (for say, personal image icons on most message boards, dating sites, etc)allow you to do that? Wouldn't that function be somehow accessible via flash?

    I don't necessarily think it would open up the possibility of making the users' comp vulnerable to virus' and such, anymore than standard dialogue windows would, since it's using the same function. Then again, I have no idea about this kind of stuff, which is why I'm asking...

  6. #6
    Member
    Join Date
    Dec 2003
    Posts
    58
    It cannot be done with Flash. Again: security considerations of Macromedia. And I for one, think it's pretty obvious, why Flash-movies aren't allowed to take files from the user's system and send them somewhere.

    So, to create an upload-form you gotta use pure HTML, like so:

    <input type="file" name"whateveryoulike">

    That will create a textfield with a "browse..." button next to it.

    Of course, you'll also need some server-side script to process the upload ...
    Last edited by pecoes; 12-19-2003 at 04:40 AM.

  7. #7
    Developer
    Join Date
    Sep 2001
    Location
    The Bluegrass State Will Flash For Food ™
    Posts
    3,789
    Flash can call the file upload in a html window...

    Code:
    <html><head></head><body>
         <div style="visibility:hidden;">
              <form name="ulform" id="ulform" action="ul.cfm">
                   <input type="file" id="ul" name="ul" 
                        onchange="document.flashMovie.SetVariable('_txt.text', this.value)" />
              </form>
         </div>
    </body></html>
    code:
    _btn.onRelease = function() {
    getURL("javascript:document.ulform.ul.click(); void(0);");
    }



    something like that...
    Last edited by gSOLO_01; 12-19-2003 at 09:06 AM.

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