A Flash Developer Resource Site

Results 1 to 20 of 20

Thread: Flash 8 -> browse -> path to the file

  1. #1
    Junior Member
    Join Date
    Nov 2001
    Posts
    7

    Flash 8 -> browse -> path to the file

    flash.net.FileReferenceList -
    FileReference -
    but FileReference.name represents the name of the file on the local disk.
    How can i get the path to the file? (4 ex, C:\Documents and Settings\admin\Desktop\IM000435.MPG)

  2. #2
    Senior Moderator
    Join Date
    Apr 2000
    Location
    Sheffield, UK
    Posts
    3,881
    You cannot get the full path to the file, as this would be a security risk.

    However the source of the file is sent to the server, so you dont really need to know the file path to upload a file.

  3. #3
    Junior Member
    Join Date
    Nov 2001
    Posts
    7

    security risk?

    security risk?

    old html form:

    HTML Code:
    <form name="form2" enctype="multipart/form-data" method="post">
      <input  type="file" name="file2" value="">
      <input type="reset" >
    </form>
    simple JavaScript

    HTML Code:
    path_2_file=document.form2.file2.value;
    path_2_file is the full path to the file. is this Security Risk?

    i dont need to know the file path to upload a file.

    i need to know the path to the file to open this file in Flash.

    HTML Code:
    //-- something like this
    fileUpload = new Object ();
    fileRef = new flash.net.FileReference ();
    fileRef.addListener (fileUpload);
    onBrowse = function () {
    	// ask the user to choose a file to upload
    	fileRef.browse ();
    
                  //--- it's my dream
                 path_2_file=fileRef.give_me_path_2_file_please();
    };
    //--- browse - is the button
    browse.addEventListener ('click', onBrowse);
    
    
    //-- and that i really need 
    
    var my_sound:Sound = new Sound();
    my_sound.loadSound(path_2_file, false);
    my_sound.start();
    flash mp3 player new generation.
    Last edited by Al_S_Asha; 08-15-2005 at 09:40 AM.

  4. #4
    Senior Moderator
    Join Date
    Apr 2000
    Location
    Sheffield, UK
    Posts
    3,881
    yes, i know. But Macromedia considered it a security risk. I agree with you, but that is how it is.

  5. #5
    Junior Member
    Join Date
    Nov 2001
    Posts
    7
    may be full_path_to_the_file is hidden or nondocumented?
    i really need full_path_to_the_file.
    where is Flash 9 wish list?
    Last edited by Al_S_Asha; 08-23-2005 at 02:54 PM.

  6. #6
    Senior Moderator
    Join Date
    Apr 2000
    Location
    Sheffield, UK
    Posts
    3,881
    Nope, its not undocumented or hidden, it just doesnt exist unfortuneatley.

  7. #7
    Junior Member
    Join Date
    Nov 2001
    Posts
    7
    bad news
    my first 8ball disappointment

  8. #8
    Senior Member whispers's Avatar
    Join Date
    Mar 2001
    Location
    CFA2h (respect the HEX)
    Posts
    12,755
    can you use a batch file or something 3rd party...

    or how about try using an environment variable %name% type of solution?

  9. #9
    Junior Member
    Join Date
    Nov 2001
    Posts
    7
    type of solution?
    FileReference.copyIntoCache() Creates a copy of the file in the local Internet cache.
    http://livedocs.macromedia.com/centr...e=00000275.htm

  10. #10
    Developer
    Join Date
    Sep 2001
    Location
    The Bluegrass State Will Flash For Food ™
    Posts
    3,786
    Central's File IO is a bit more featureful than the Player 8 implementation. I doubt you will see that level of access for the browser plug-in anytime in the near future.

  11. #11
    Senior Moderator
    Join Date
    Apr 2000
    Location
    Sheffield, UK
    Posts
    3,881
    Agreed. Central is an offline application and thus it needs to have that kind of capability. However, im not so sure it is needed with the web plugin, after all what can u do with the file path? you already have the filename.

  12. #12
    Junior Member
    Join Date
    Nov 2001
    Posts
    7
    what can i do with the file path?

    path_2_file=FileReference.give_me_path_2_file_plea se();

    var my_sound:Sound = new Sound();
    my_sound.loadSound(path_2_file, false);
    my_sound.start();

    flash8_mp3_player

  13. #13
    Senior Moderator
    Join Date
    Apr 2000
    Location
    Sheffield, UK
    Posts
    3,881
    Nope, that would be a security breach aswell as the local machine is outside of the domain that the Flash Player is running in.

  14. #14
    Junior Member
    Join Date
    Sep 2005
    Posts
    1
    I wanted to do something similar... Allow a user to select images from their harddrive and see them within flash before selecting whether to upload them or not. It didn't seem to be possible from my attempts so it may be a case of forgetting about the flash 8 feature and using a exe wrapping program (since this is for a standalone app)...

    Unless anyone knows different?

  15. #15
    Junior Member
    Join Date
    Nov 2001
    Posts
    7
    it's possible (allow a user to select images from their harddrive and see them within flash before selecting whether to upload them or not), but will work only in IE (win).

  16. #16
    Junior Member
    Join Date
    Feb 2001
    Posts
    6

    need to know as well

    Hi, this is a major omission. I need it as well. I have files over 100 meg that I need to upload and would like to use sendAndLoad to Post them to a form for upload. I've been playing around to no avail.

    Any ideas here.

    Why 100 meg restriction??

    Marty
    Thanks, Marty

  17. #17
    Junior Member
    Join Date
    Apr 2008
    Posts
    1

    hi Al_S_Asha...

    Quote Originally Posted by Al_S_Asha
    it's possible (allow a user to select images from their harddrive and see them within flash before selecting whether to upload them or not), but will work only in IE (win).

    i would like to know about the solution...
    please do let me know...

    thanks in advance...
    Edit by admin: no contact info permitted on the forum, thank you

  18. #18
    Senior Member whispers's Avatar
    Join Date
    Mar 2001
    Location
    CFA2h (respect the HEX)
    Posts
    12,755
    I thought the 100MB restriction was only if your PHP kept it as such?

    have you done a search on FileReference upload limit?

    and Im un-sure of how you can get a 'preview' of an image that is local on you hard drive to be displayed in your web app/site?

    BEFORE uploading it?

  19. #19
    Bearded (M|G)od MyFriendIsATaco's Avatar
    Join Date
    Dec 2002
    Location
    Awesomeville.
    Posts
    3,045
    The 100MB limit is NOT based on your PHP settings. It is a Flash restriction. Ever notice why YouTube has a 100MB limit?

  20. #20
    Senior Member whispers's Avatar
    Join Date
    Mar 2001
    Location
    CFA2h (respect the HEX)
    Posts
    12,755
    I dont hang out on 'YouTube.com'

    well then I guess MANY others have posted incorrect information.. I have read several times that the limit is NOT valid.. and is usually restricted by (if using PHP) their PHP config file.

    I have seen that FLASH has a limit.. but when reading up on this before..this is the info that has been passed on.

    100MB is the limit tested (and I guess supported by Adobe/MM) however I have seen many posts where people claim to have done OVER that limit using PHP or CF.. just make sure the settings are not capping you.

    Try it.. post back.

    regardless that really isnt the focus of the last posters question..(I was just commenting on it)

    again..."I" cant say for sure.. but what Ive read was that MM said 100 MB was the limit that they tested.. after that.. no clue.. if your PHP script is not limiting/capping you at 100 (or under even, as most do)

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