Switch branches/tags
Nothing to show
Find file
Fetching contributors…
Cannot retrieve contributors at this time
executable file 39 lines (33 sloc) 1.5 KB
<cfinclude template="header.cfm">
<h1>Malicious File Uploads Filter</h1>
<p>This filter allows you to block or log requests in which a file upload takes place based on the file extension passed by the client. You can either provide a whitelist or blacklist of extensions.</p>
<!--- Windows Example --->
<!--- Check to see if the Form variable exists. --->
<cfif isDefined("Form.FileContents") >
<!--- If TRUE, upload the file. --->
<cffile action = "upload"
fileField = "FileContents"
destination = "#ExpandPath( "./" )#/upload"
accept = "image/gif,image/png,application/msword,application/pdf,application/vnd.openxmlformats-officedocument.wordprocessingml.document,application/excel,application/vnd.openxmlformats-officedocument.spreadsheetml.sheet,image/jpeg"
nameConflict = "overwrite">
<form class="well form-search" method="post" name="uploadForm" enctype="multipart/form-data">
<input name="FileContents" type="file">
<button class="btn btn-primary" name="submit" type="submit">Upload file</button>
DIRECTORY="#ExpandPath( "./" )#/upload"
SORT="DateLastModified DESC">
<h2>My Files</h2>
<cfif myfiles.recordcount>
<CFOUTPUT QUERY="myfiles">
<p>#myfiles.Name# #myfiles.DateLastModified#<br /></p>
No Files Found in Upload Folder
<cfinclude template="footer.cfm">