İptal Edildi

CFM scripts not consistently listing contents of folder

I upload muliple types of files to the server. Sometimes they are folders, word docs, ppts, pdfs or xls files. There is a script that runs that is supposed to list everything that I have uploaded into a directory. The problem is, it does not work consistently. Sometimes it will display all files, subdirectories, file within, sometimes it will say that nothing is there. I am not sure why it will work with some files/folders, and won't with others. I need to have this work consistently across the site where I use this tool. It may be a permissions problem, I'm not sure...

Here's a sample script that lists the contents of the directory:

<cfinclude template="../usercheck.cfm">

<cfparam name="URL.module" default="">

<cfparam name="URL.file" default="">

<cfparam name="URL.action" default="">

<HTML>

<HEAD>

<TITLE>Title</TITLE>

<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">

<link href="../links.css" rel="stylesheet" type="text/css">

<!-- End Preload Script -->

<style type="text/css">

<!--

.style3 {color: #FFFFFF; font-weight: bold; }

.style6 {font-size: 10px}

-->

</style>

</HEAD>

<BODY BGCOLOR=#FFFFFF LEFTMARGIN=0 TOPMARGIN=0 MARGINWIDTH=0 MARGINHEIGHT=0 ONLOAD="preloadImages();">

<a href="/index.html"><img src="/Images/graphic.gif" width="169" height="84" border="0"></a>

<br>

<cfset pathn = "#getDirectoryFromPath(cgi.PATH_TRANSLATED)#files">

<CFIF ([url removed, login to view] IS NOT '')>

<CFDIRECTORY ACTION="LIST"

DIRECTORY="#pathn##urldecode([url removed, login to view])#"

NAME="FileCheck"

FILTER="#URL.file#">

<cfif [url removed, login to view] eq "Delete">

<CFIF [url removed, login to view] GT 0>

<cffile file="#pathn##urldecode([url removed, login to view])##URL.file#" action="delete">

<cflocation url="[url removed, login to view]([url removed, login to view])#">

</CFIF>

<cfelse>

<CFIF [url removed, login to view] GT 0>

<!--- <cfhttp

method="Get"

url="#getdirectoryfrompath(pathn)##URL.file#"

path="#pathn#"

file="#URL.file#"> --->

<CFHEADER

NAME="content-disposition"

VALUE="attachment; filename=#URL.file#">

<CFCONTENT type="application/unknown" file="#pathn##URLdecode([url removed, login to view])##URL.file#" DeleteFile="No"></CFCONTENT>

</CFIF>

</cfif>

<cfelse>

<CFDIRECTORY ACTION="LIST"

DIRECTORY="#pathn##urldecode([url removed, login to view])#"

NAME="dirlist">

<table width="487" border="0" align="center">

<tr bgcolor="#004B8D">

<td width="479" height="36"><span class="style3"> Physician Modules </span></td>

<td></td>

</tr>

<cfif #dirlist.recordcount# gt 2>

<CFOUTPUT QUERY="dirlist">

<CFIF type IS 'File'>

<tr bordercolor="##D5EBFF" bgcolor="##D5EBFF">

<td width="479" bordercolor="##D5EBFF" bgcolor="##F4FAFF" class="links">

<span class="style6"><a href="#cgi.SCRIPT_NAME#?module=#URLEncodedFormat([url removed, login to view])#&file=#name#"> #left(name,len(name)-4)#</a></span>

</td>

<td width="50" bgcolor="##FFFFFF">

<cfswitch expression="#right(name,3)#">

<cfcase value="xls">

<cfset imagesrc="/Images/excel.gif">

</cfcase>

<cfcase value="pdf">

<cfset imagesrc="/Images/pdf.gif">

</cfcase>

<cfcase value="doc">

<cfset imagesrc="/Images/word.gif">

</cfcase>

<cfcase value="ppt">

<cfset imagesrc="/Images/powerpoint.gif">

</cfcase>

<cfdefaultcase>

<cfset imagesrc="/Images/unknown.gif">

</cfdefaultcase>

</cfswitch>

<div align="center"><img src="#imagesrc#" width="31" height="27"></div>

</td>

</tr>

<cfelseif type eq 'Dir'>

<cfif ((name neq "." ) AND (name neq "..")) >

<cfset tempname = #url.module# & "" & #name#>

<tr bordercolor="##D5EBFF" bgcolor="##D5EBFF">

<td bordercolor="##D5EBFF" bgcolor="##F4FAFF" class="links"><a href="#CGI.SCRIPT_NAME#?module=#URLEncodedformat(tempname)#">#name#</a></td>

<td bgcolor="##FFFFFF" class="links">Directory</td>

</tr>

</cfif>

</cfif>

</cfoutput>

<cfelse><!--- <cfif #dirlist.recordcount# lt 2> --->

<tr bordercolor="#D5EBFF" bgcolor="#D5EBFF">

<td bordercolor="#D5EBFF" bgcolor="#F4FAFF" class="links">

<span class="style6">No Files Found</a></span></td>

<td bgcolor="#FFFFFF"> </td>

</tr>

</cfif>

</table>

</cfif>

<table width="100%" border="0" cellpadding="0" cellspacing="0" class="links">

<tr>

<td height="50" align="center" valign="middle" class="links">

<cfinclude template="../navmenu.cfm">

</td>

</tr>

</table>

</BODY>

</HTML>

Beceriler: ColdFusion

Daha fazlasını görün: server scripts, disposition tool, delete tool, application template excel, action script list, css expression, contents of a will, word to ppt, word and powerpoint template, upload pdfs, span, pdf into powerpoint template, listing of, len, iso, img, directory listing, delete attachment, cgi images, border, bold, path pdf, script head http, img table, upload gif

İşveren Hakkında:
( 100 değerlendirme ) Edgartown, United States

Proje NO: #128765