Here is a little program that I wrote that you can add unc paths of shared
mp3 and get a complete list of files!  But I don't use cfcontent to stream
them, I just point to the path and file name.

<cfset pathlist="\\COMPUTER1\MY Music\,\\COMPUTER2\MP3\, ETC.......">
<!------
GET ALL SUBPATHS 
------->
<CFLOOP index="path" list="#pathlist#" delimiters=",">
        <CFDIRECTORY    ACTION="List"
                                        DIRECTORY="#path#"
                                        NAME="myDirectory"
                                        SORT="type ASC, name ASC">
        <CFLOOP QUERY="myDirectory">
                <cfif #type# is 'DIR'>
                        <cfif name neq ".." and name neq ".">
                                <CFSET t = "#path##name#/" >
                                <CFSET pathlist = ListAppend( "#pathlist#",
"#t#" ) >
                        </CFIF>
                </CFIF>
        </CFLOOP>
</CFLOOP>

<CFSCRIPT>
        count = 0;
        mp3list = ArrayNew(1);
</CFSCRIPT>

<!--------
GET ALL FILES
-------->
<CFLOOP index="path" list="#pathlist#" delimiters=",">
        <CFDIRECTORY    ACTION="List"
                                        DIRECTORY="#path#"
                                        NAME="myDirectory"
                                        SORT="type ASC, name ASC">
                <CFLOOP QUERY="myDirectory">
                        <cfif type neq 'DIR' and name neq '..' and Name neq
".">
                                <CFSCRIPT>
                                count = count + 1;
                                mp3list[count] = "<!--#Name#--><A
HREF=""#path##Name#"">#Name#</a>";
                                </CFSCRIPT>      
                        </cfif>
                </CFLOOP>
        </cfloop>

<CFSET sorted_mp3list = ArraySort(mp3list, "textnocase")>
       
<!--------
PRINT OUT THE FILES
-------->       
<CFOUTPUT>
Number of songs in our list: #count#<br><br>
<CFLOOP index="i" from="1" to="#ArrayLen(mp3list)#">
        #mp3list[i]#<BR>       
</CFLOOP>

</CFOUTPUT>



-----Original Message-----
From: Rich Z [mailto:[EMAIL PROTECTED]]
Sent: Monday, June 04, 2001 11:19 PM
To: CF-Talk
Subject: Sending MP3's Through CF


I figured out a way to send mp3's through a web server on demand
(pseudo-streaming by using CFCONTENT w/ a mime-type of audio/mpegurl.
The page that does the sending looks like this:
 
<CFCONTENT TYPE="audio/x-mpegurl">
<cfoutput>
#EXTM3U
#EXTINF:-1,#title#
http://my.server/mp3/#streamurl#
</cfoutput>
 
My question: I'd like to still do the above without mapping my mp3
folder on the web server and referring to my own server. As it is -
people can snoop around the /mp3 folder on the web server. Any
suggestions on how to get around this?
 
Thanks,
Rich
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Structure your ColdFusion code with Fusebox. Get the official book at 
http://www.fusionauthority.com/bkinfo.cfm

Archives: http://www.mail-archive.com/[email protected]/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists

Reply via email to