Directory listing stored in database

Ask a Question related to Macromedia ColdFusion, Design and Development.

  1. #1

    Default Directory listing stored in database

    I have an archive section of a web site that contains a bunch of text, word and
    PDF documents that users add and delete. I want a method to have CF scan the
    directory, store the list of file names and links and display them on a dynamic
    page.

    Does anyone have a script to do such a thing? much thanks in advance!

    kdg

    kdgayle Guest

  2. Similar Questions and Discussions

    1. Directory Listing Denied
      when I configure the sample of the .net framework, the browser list this message .,? Directory Listing Denied This Virtual Directory does not...
    2. listing a Directory files
      hello community i want to make a directory list i have pdf documents in a list 101_4326.pdf 101_4325.pdf 201_4324.pdf 201_4328.pdf but i only...
    3. Directory listing
      Hi php-general, I'm reading through the filesystem function of php and I can't find any function which will list me all the files which are in a...
    4. [PHP] directory listing
      Wrong place, look at directory functions ;) Matthias Wulkow wrote:
    5. CD Directory Listing
      Is it possible to get the Directory listing from a CD in order to write it to a searchable database? If so does anyone know where I can get this...
  3. #2

    Default Re: Directory listing stored in database

    See <CFDIRECTORY> at [url]http://livedocs.macromedia.com/coldfusion/5.0/CFML_Reference/Tags14.htm#1097918[/url]
    jdeline Guest

  4. #3

    Default Re: Directory listing stored in database

    Thanks, now all I need to do is dump this cfdirectory query into a database, ideas? (of course you can tell that I am extremely new at this, I appreciate all the help!)

    kdg
    kdgayle Guest

  5. #4

    Default Re: Directory listing stored in database

    If your users add and delete items through the file system, your database info
    will get out of sync in a hurry. Why not just display the results of the
    CFDIRECTORY query?

    Try this script. Replace the maindir value with your top archive directory.

    <cfset maindir="\\server\sharename">
    <CFDIRECTORY ACTION="LIST"
    DIRECTORY="#maindir#"
    NAME="ProjectDir"
    SORT="type,name">

    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">

    <html>
    <head>
    <title>Untitled</title>
    </head>

    <body>
    <table style="font-family:Verdana;font-size:8pt;">
    <cfoutput query="ProjectDir">
    <cfif left(name,1) NEQ ".">
    <tr>
    <td><a href="file:///#maindir#\#Name##iif(type is
    "dir",de("\"),de(""))#">#name#</a></td><td>#iif(type NEQ
    "dir",de(Size),de("(Directory)"))#</td><td>#DateLastModified#</td>
    </tr>
    </cfif>
    </cfoutput>
    </table>

    </body>
    </html>

    philh Guest

  6. #5

    Default Re: Directory listing stored in database

    Phil, thanks... My thought was to have a script run when a user clicked, dump
    the most current directory read into the database, then redirect to a CFM page
    to display the recordset by whatever criteria the user wanted (title, type,
    etc). And the file path would then be relative rather than absolute. But, alas,
    in my febble mind this should work, but in reality, I leave to you good
    folks... but I have learned something today and I thank you for that...

    kdg

    kdgayle Guest

Posting Permissions

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

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139