Hi guys,
Yesterday we upgraded to the Coldfusion MX. Most things are working but some code is
giving us trouble.
This one piece of code, now doesn't work because of periods in the variables. The
cfml looks at a directory, uploads any new files, and adds their name to the database.
The problem seems to be that it doesn't like the periods in the file names. Any ideas
how to fix this?
Thanks,
Brad Fetter
[EMAIL PROTECTED]
503-372-6116
-----------------------------------------------------
<CFDIRECTORY sort="name
ASC,
size
DESC"
action="LIST" name ="myDirectory"
directory="\\INTRAFLIR\media pending" >
<CFSCRIPT>
File = ArrayNew( 1);
</cfscript>
<CfQuery name="medialist" datasource="Portdw">
Select Filename, Filesize
>From Media
</CFQUERY>
<cfset path2 = medialist.recordcount/500>
<cfset path =ceiling(path2)>
<Cfoutput query="medialist">
<CFSET ArrayAppend(File, #Filename# )>
</CFOUTPUT>
<cfloop query="mydirectory" >
<CFIF '#ArrayToList(file)#' does not contain mydirectory.name >
<cfif type eq 'dir'><cfelse>
<CFQUERY Name="#name#" DataSource="Portdw">
INSERT INTO dbo.media (Filename, datein, status, filesize, filetype, path)
VALUES ('#name#',#now()#, 'pending', '#size#', '#type#', '#variables.path#' )
</CFQUERY>
<cffile action="Move"
Source="d:\inetpub\wwwroot\portland\medialibrary\mediaADD\#name#"
Destination="d:\inetpub\wwwroot\portland\medialibrary\media\#variables.path#\">
<CFQUERY NAME="get_last_record"
Datasource= "portdw">
Select Max(ID) as maxnumber
FROM dbo.media
</CFQUERY>
<cfoutput query="get_last_record">
<CFSET maxnumber ="#maxnumber#">
</CFOUTPUT>
<!--- <cfmail to="[EMAIL PROTECTED]" from="[EMAIL PROTECTED]" subject="A Document has
been been added to the Media Library" bcc="[EMAIL PROTECTED]">
A new Document, #name# has been added to the Media Library "Pending" folder. Please
visit http://intraflir/portland/medialibrary/pending.cfm to publish the document to
the IntraFLIR Media library.
Thanks,
Neo
</cfmail>
--->
</cfif> <cfelse></CFIF>
</CFLOOP>
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Archives: http://www.houseoffusion.com/cf_lists/index.cfm?forumid=4
Subscription:
http://www.houseoffusion.com/cf_lists/index.cfm?method=subscribe&forumid=4
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
This list and all House of Fusion resources hosted by CFHosting.com. The place for
dependable ColdFusion Hosting.
http://www.cfhosting.com
Unsubscribe:
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4