cheers kim [allowsmilie] => 1 [showsignature] => 0 [ipaddress] => [iconid] => 0 [visible] => 1 [attach] => 0 [infraction] => 0 [reportthreadid] => 0 [isusenetpost] => 1 [msgid] => [ref] => [htmlstate] => on_nl2br [postusername] => kim il sung [ip] => webforumsuser@m [isdeleted] => 0 [usergroupid] => [membergroupids] => [displaygroupid] => [password] => [passworddate] => [email] => [styleid] => [parentemail] => [homepage] => [icq] => [aim] => [yahoo] => [msn] => [skype] => [showvbcode] => [showbirthday] => [usertitle] => [customtitle] => [joindate] => [daysprune] => [lastvisit] => [lastactivity] => [lastpost] => [lastpostid] => [posts] => [reputation] => [reputationlevelid] => [timezoneoffset] => [pmpopup] => [avatarid] => [avatarrevision] => [profilepicrevision] => [sigpicrevision] => [options] => [akvbghsfs_optionsfield] => [birthday] => [birthday_search] => [maxposts] => [startofweek] => [referrerid] => [languageid] => [emailstamp] => [threadedmode] => [autosubscribe] => [pmtotal] => [pmunread] => [salt] => [ipoints] => [infractions] => [warnings] => [infractiongroupids] => [infractiongroupid] => [adminoptions] => [profilevisits] => [friendcount] => [friendreqcount] => [vmunreadcount] => [vmmoderatedcount] => [socgroupinvitecount] => [socgroupreqcount] => [pcunreadcount] => [pcmoderatedcount] => [gmmoderatedcount] => [assetposthash] => [fbuserid] => [fbjoindate] => [fbname] => [logintype] => [fbaccesstoken] => [newrepcount] => [vbseo_likes_in] => [vbseo_likes_out] => [vbseo_likes_unread] => [temp] => [field1] => [field2] => [field3] => [field4] => [field5] => [subfolders] => [pmfolders] => [buddylist] => [ignorelist] => [signature] => [searchprefs] => [rank] => [icontitle] => [iconpath] => [avatarpath] => [hascustomavatar] => 0 [avatardateline] => [avwidth] => [avheight] => [edit_userid] => [edit_username] => [edit_dateline] => [edit_reason] => [hashistory] => [pagetext_html] => [hasimages] => [signatureparsed] => [sighasimages] => [sigpic] => [sigpicdateline] => [sigpicwidth] => [sigpicheight] => [postcount] => 2 [islastshown] => [isfirstshown] => [attachments] => [allattachments] => ) --> CFC , CFDIRECTORY into Array - Coldfusion - Getting Started

CFC , CFDIRECTORY into Array - Coldfusion - Getting Started

Hi, im trying to create a CFC that looks into a folder and returns all the files into an arrya that i will put into flash.. at the moment when i try to load into flash its telling me its not in an array format... any help would greatfully recieved... my CFC has the following code.. <cfcomponent> <cffunction name="getInfo" access="remote" returntype="array"> <cfdirectory directory="C:\CFusionMX\wwwroot\Gem-A\test\flashtxt\content\" name="myDirectory" sort="name ASC"> <cfreturn "mydirectory"> </cffunction> </cfcomponent>...

  1. #1

    Default CFC , CFDIRECTORY into Array

    Hi, im trying to create a CFC that looks into a folder and returns all the
    files into an arrya that i will put into flash..

    at the moment when i try to load into flash its telling me its not in an array
    format...

    any help would greatfully recieved...

    my CFC has the following code..

    <cfcomponent>
    <cffunction name="getInfo" access="remote" returntype="array">
    <cfdirectory
    directory="C:\CFusionMX\wwwroot\Gem-A\test\flashtxt\content\"
    name="myDirectory" sort="name ASC">
    <cfreturn "mydirectory">
    </cffunction>
    </cfcomponent>

    stebennettsjb Guest

  2. #2

    Default Re: CFC , CFDIRECTORY into Array

    cfdirectory returns query, not array. so you have to populate array from query.

    example:
    <cfdirectory
    directory="C:\CFusionMX\wwwroot\Gem-A\test\flashtxt\content\"
    name="myDirectory" sort="name ASC">

    <!--- Declare the array --->
    <cfset myarray=arraynew(2)>

    <!--- Populate the array row by row --->
    <cfloop query="myDirectory">
    <cfset myarray[CurrentRow]=file>
    <cfset myarray[CurrentRow]=type>
    <cfset myarray[CurrentRow]=size>
    </cfloop>

    <cfreturn "myarray">

    cheers kim

    kim il sung Guest

  3. #3

    Default Re: CFC , CFDIRECTORY into Array

    Hi kim il sung, thanks for the help...but im still get the same error...

    the full details of the error are below...

    MethodName: "/1/onStatus"
    ResponseURI: (undefined)
    Parameters (object #2)
    .....code: "Server.Processing"
    .....description: "The value returned from function getInfo() is not of type
    array."
    .....details: ""
    .....level: "error"
    .....type: ""
    .....rootcause (object #3)
    ..........code: (undefined)
    ..........description: "The value returned from function getInfo() is not of
    type array."
    ..........details: ""
    ..........level: "error"
    ..........type: ""


    thanks

    Stephen

    stebennettsjb Guest

  4. #4

    Default Re: CFC , CFDIRECTORY into Array

    i am not sure but maybe <cfreturn "myarray"> should be <cfreturn myarray>.
    kim
    kim il sung Guest

Similar Threads

  1. Problem with cfdirectory
    By qgh in forum Coldfusion - Getting Started
    Replies: 6
    Last Post: July 14th, 06:07 PM
  2. CFDIRECTORY - RECURSIVE LOOK IN
    By maquejp in forum Coldfusion - Advanced Techniques
    Replies: 2
    Last Post: May 30th, 07:34 AM
  3. How do I use CFtree and CFdirectory?
    By fvanstaveren in forum Coldfusion - Advanced Techniques
    Replies: 0
    Last Post: May 5th, 04:38 PM
  4. URL Shortcuts in CFDIRECTORY?
    By remecTim in forum Coldfusion - Advanced Techniques
    Replies: 0
    Last Post: May 4th, 04:23 PM
  5. sorting in <cfdirectory>
    By joonstar in forum Macromedia ColdFusion
    Replies: 1
    Last Post: May 3rd, 10:59 AM

Bookmarks

Posting Permissions

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