comparison wiki/htdocs/applets/FCKeditor/editor/filemanager/connectors/cfm/cf_upload.cfm @ 3954:6089ade226fb

replace fckeditor with clean up version
author Byeongweon [tasyblue@gmail.com]
date Sat, 21 Jun 2008 17:38:55 +0900
parents
children 1d37117f8ca6
comparison
equal deleted inserted replaced
3953:61c3a8a4f25d 3954:6089ade226fb
1 <cfsetting enablecfoutputonly="yes" showdebugoutput="no">
2 <!---
3 * FCKeditor - The text editor for Internet - http://www.fckeditor.net
4 * Copyright (C) 2003-2008 Frederico Caldeira Knabben
5 *
6 * == BEGIN LICENSE ==
7 *
8 * Licensed under the terms of any of the following licenses at your
9 * choice:
10 *
11 * - GNU General Public License Version 2 or later (the "GPL")
12 * http://www.gnu.org/licenses/gpl.html
13 *
14 * - GNU Lesser General Public License Version 2.1 or later (the "LGPL")
15 * http://www.gnu.org/licenses/lgpl.html
16 *
17 * - Mozilla Public License Version 1.1 or later (the "MPL")
18 * http://www.mozilla.org/MPL/MPL-1.1.html
19 *
20 * == END LICENSE ==
21 *
22 * File Browser connector for ColdFusion (MX 6.0 and above).
23 * (based on the original CF connector by Hendrik Kramer - hk@lwd.de)
24 --->
25
26 <cfparam name="url.type" default="File">
27 <cfparam name="url.currentFolder" default="/">
28
29 <!--- note: no serverPath url parameter - see config.cfm if you need to set the serverPath manually --->
30
31 <cfinclude template="config.cfm">
32 <cfinclude template="cf_util.cfm">
33 <cfinclude template="cf_io.cfm">
34 <cfinclude template="cf_commands.cfm">
35
36 <cffunction name="SendError" returntype="void" output="true">
37 <cfargument name="number" required="true" type="Numeric">
38 <cfargument name="text" required="true">
39 <cfreturn SendUploadResults( "#ARGUMENTS.number#", "", "", "ARGUMENTS.text" )>
40 </cffunction>
41
42 <cfset REQUEST.Config = Config>
43 <cfif find( "/", getBaseTemplatePath() ) >
44 <cfset REQUEST.Fs = "/">
45 <cfelse>
46 <cfset REQUEST.Fs = "\">
47 </cfif>
48
49 <cfif not Config.Enabled>
50 <cfset SendUploadResults( '1', '', '', 'This file uploader is disabled. Please check the "editor/filemanager/connectors/cfm/config.cfm" file' )>
51 </cfif>
52
53 <cfset sCommand = 'QuickUpload'>
54 <cfset sType = "File">
55
56 <cfif isDefined( "URL.Type" )>
57 <cfset sType = URL.Type>
58 </cfif>
59
60 <cfset sCurrentFolder = GetCurrentFolder()>
61
62 <!--- Is enabled the upload? --->
63 <cfif not IsAllowedCommand( sCommand )>
64 <cfset SendUploadResults( "1", "", "", "The """ & sCommand & """ command isn't allowed" )>
65 </cfif>
66
67 <!--- Check if it is an allowed type. --->
68 <cfif not IsAllowedType( sType )>
69 <cfset SendUploadResults( "1", "", "", "Invalid type specified" ) >
70 </cfif>
71
72 <cfset FileUpload( sType, sCurrentFolder, sCommand )>