A Flash Developer Resource Site

Results 1 to 3 of 3

Thread: File list?

  1. #1
    Member
    Join Date
    May 2002
    Posts
    97

    Red face

    I give up. I've searched online and in the actionscript guide and just about everywhere else....

    How can I get a list of files from a folder on the server? What I want to do is grab all files from a jpg folder, then allow the user to click on a scroll box to bring up that jpg in its own movieclip. I'll add more bells and whistles once I get this bit working.

    And while I'm asking, is there a way to extract jpg file data from the file itself? Worst case is that I'm going to write a small utility to do this in another program, and make the webmaster build his own list when he updates the folder before the upload (using the utility), but it would be so much easier to let him just add photos to the jpg folder and let the browser and flash do the work.

    I've done similar with VBA for local applications, but don't know if this can even be done with action script/Flash.

    I'm not asking for someone to do this for me... just point me in the right direction for the information. I've tried the search here, but to no avail. I've probably entered the wrong search criteria or something.

    Thanks in advance for any help,
    Don

  2. #2
    Senior Member
    Join Date
    Mar 2002
    Posts
    116
    As far as I know, it can't be done as Flash, but in ColdFusion, you can use the CFDirectory tag.

    (Please note this is HTML version. You can modify the output to set it to variables or XML as needed)

    Get the contents of the folder :

    < CFDIRECTORY ACTION=list DIRECTORY="D:\yoursite\IMAGES\SmallPhotos" NAME=SmallPhotos SORT="Name ASC" >

    Put them in a listbox :

    < SELECT NAME="SmallPhoto" SIZE=8 VALUE="" CLASS="SmallTextBoldBlue" >
    < CFLOOP QUERY=SmallPhotos >
    < CFIF type IS NOT "Dir" >
    < CFOUTPUT >
    < OPTION VALUE="#NAME#" > #NAME# </ OPTION >
    < /CFOUTPUT >
    < /CFIF >
    < /CFLOOP >
    < /SELECT >

    This makes a select box that has all of the contents of the folder you specify... You could change it to not be inside of a listbox, instead be a string of text, or whatever you need to get it into flash... but you're not going to be able to do it with just Flash.

    I'm sure that ASP, Java, and PHP have similar commands, but I don't know them. But you will definatly need something running on the server.

    (ps - sorry to any moderators, I know this isn't a ColdFusion forum... it's just what I'd use)

  3. #3
    Senior Member
    Join Date
    Jun 2000
    Posts
    687
    Their's a similiar thread at:

    http://board.flashkit.com/board/show...hreadid=324316

    And yes this is more of a server question then a Flash MX question.

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