SitePoint Sponsor

User Tag List

Results 1 to 7 of 7

Hybrid View

  1. #1
    SitePoint Wizard davidjmedlock's Avatar
    Join Date
    Dec 2002
    Location
    Nashville, TN USA
    Posts
    1,688
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Quick and Dirty directory listing

    Necessity is the mother of invention, you know. I needed to do a quick directory listing on my shared web space. Yes, I could have done and FTP in and looked at what was there, but FTP has its restrictions (can't click into a CF file and have it processed by CF server...). So, I threw together this handy little template.

    It is 100% self contained, one file is all you need. You can name it anything you like and simply upload it to your web server and use it. It also detects if there is a template in the directory above it with the same name and puts a link to that template if there is (i.e. the "Up One Level" button in Windows Exploder) and it also detects the existence of "itself" in any subdirectory and links through to it appropriately. It also allows for clicking a link to any file in the directory.

    Now, this is a simple quick and dirty utility script and NOT MEANT TO BE USED ON A PRODUCTION SERVER. It's just one of those things that may come in handy sometimes during development. Make sure you don't have this template anywhere on your live, public facing server or it could expose some sensitive data (i.e. the location of your webroot...)

    Feel free to modify this, use this however you want. I just thought it was a handy little utility, and don't we all love new widgets, especially when they're free?

    (The attachment is pending approval by a mod. It should show up shortly.)

    Enjoy.
    Attached Files Attached Files

  2. #2
    SQL Consultant gold trophysilver trophybronze trophy
    r937's Avatar
    Join Date
    Jul 2002
    Location
    Toronto, Canada
    Posts
    39,350
    Mentioned
    63 Post(s)
    Tagged
    3 Thread(s)
    Quote Originally Posted by davidjmedlock
    NOT MEANT TO BE USED ON A PRODUCTION SERVER.
    why not?

    i tried it on my production server, and it works fine
    rudy.ca | @rudydotca
    Buy my SitePoint book: Simply SQL
    "giving out my real stuffs"

  3. #3
    minister of propaganda silver trophy Rynoguill's Avatar
    Join Date
    Feb 2004
    Location
    Midsouth
    Posts
    1,373
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    daves just giving a disclaimer, so hes not responsible if something goes wrong. im sure daves stuff is production quality, but he probably doesnt want it crashing on you and him having to be responsible for your lost time/data/energy. im really looking forward to trying this out, just havent had the chance yet.
    rynoguill
    Ryan Guill, AKA Mark Roman

  4. #4
    SitePoint Wizard davidjmedlock's Avatar
    Join Date
    Dec 2002
    Location
    Nashville, TN USA
    Posts
    1,688
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    You're right, Rudy, it will work on a production server, but it's a script that I just threw together, and as Mark said, I don't want anyone to use it, blow something up, and then come back and say "You're script is not secure!" I didn't write it with security in mind, just with the idea of getting a job done.

    Hope you guys enjoy! Feel free to post any additions/mods you make to it as well.

  5. #5
    SQL Consultant gold trophysilver trophybronze trophy
    r937's Avatar
    Join Date
    Jul 2002
    Location
    Toronto, Canada
    Posts
    39,350
    Mentioned
    63 Post(s)
    Tagged
    3 Thread(s)
    thanks, david

    i was interested in seeing yours, because i wrote one too

    Code:
    <CFDIRECTORY NAME="mystuff"
      DIRECTORY="#ExpandPath('.')#" 
      FILTER="*.*m*"
      SORT="DateLastModified DESC">
    
    <p>
    <CFOUTPUT QUERY="mystuff">
    #mystuff.DateLastModified# 
    <a href="#mystuff.Name#"
      >#mystuff.Name#</a><br />
    </CFOUTPUT>
    </p>
    the reason for the FILTER is to display only .htm, .html, and .cfm files
    rudy.ca | @rudydotca
    Buy my SitePoint book: Simply SQL
    "giving out my real stuffs"

  6. #6
    SitePoint Wizard davidjmedlock's Avatar
    Join Date
    Dec 2002
    Location
    Nashville, TN USA
    Posts
    1,688
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by r937
    thanks, david

    i was interested in seeing yours, because i wrote one too

    Code:
    <CFDIRECTORY NAME="mystuff"
    DIRECTORY="#ExpandPath('.')#" 
    FILTER="*.*m*"
    SORT="DateLastModified DESC">
     
    <p>
    <CFOUTPUT QUERY="mystuff">
    #mystuff.DateLastModified# 
    <a href="#mystuff.Name#"
    >#mystuff.Name#</a><br />
    </CFOUTPUT>
    </p>
    the reason for the FILTER is to display only .htm, .html, and .cfm files
    Yeah, I needed to see everything in there, so I didn't filter anything out. You could always modify mine to accept a variable that allows you to filter.

    Maybe someday I'll start some sort of open source file management app in SourceForge...

  7. #7
    SitePoint Wizard jonese's Avatar
    Join Date
    Jul 1999
    Location
    Powder Springs GA (Atlanta)
    Posts
    1,238
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    This is so cool Thanks david, hopefully more of us will take the time topost our little helpful snippets.


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
  •