Removing the extension off a returned filename

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

  1. #1

    Default Removing the extension off a returned filename

    I am getting a list of files back from the cfdirectory command, and I need to hack off the file extension to present the file. What is the best way to do this?

    Thanks
    dmurray1414 Guest

  2. Similar Questions and Discussions

    1. "The filename or extension is too long" Error when opening Acrobat 6.0
      I get the same error. It just hangs at the splash screen, taking 100% CPU and then after about an hour I get that error. When I click ok, I get a...
    2. Getting only the filename ??
      I'm creating a player that allows you to have multiple files stacked and play anyone of them. The problem now is i need to get only the filename out...
    3. Get .PHP Filename?
      I've been looking thru my PHP functions and can't find what I need - is there a function that will tell me what .php file is currently executing? ...
    4. Invalid filename
      I am a beginner for Dreamweaver MX. When i use the function of inserting interactive image by: Insert --> Interactive Images --> Flash Button /...
    5. Removing desktop icon from one account is removing from all accounts
      Using XP Professional. I want the Guest account to have only a few icons. The other two accounts should have many more. When I remove the icon...
  3. #2

    Default Re: Seperating the extension off a returned filename

    Treat the filename as a period-delimited list. The first list element is the filename and the second list element is the extension.
    jdeline Guest

  4. #3

    Default Re: Seperating the extension off a returned filename

    Thanks, I ended up using the Len and Mid functions to work something out.
    dmurray1414 Guest

  5. #4

    Default Re: Seperating the extension off a returned filename

    Another way to slice this cat is to reverse the string and find the period.
    That way if the extension is longer (or shorter) than 3 characters, the code
    will still work.

    Something like this ...

    reverse( mid(reverse(targetString), 1, find(".", reverse(targetString), 1)) )

    I'm sure it can be more elegant and whatnot, but you get the idea.

    Mike Greider 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