Hi All,
I can't for the life of me get the upload tab to work in ckfinder, I have tried this forum but can't find a solution and I am thinking now it is because my ckfinder folder is not inside ckeditor.
Can somebody please help?
code
<cfquery name="select_record" datasource="#Application.dsn#"> SELECT * FROM tbl_content WHERE ID = #URL.ID# </cfquery> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <!-- This section has the head with links to js files, css etc--> <cfinclude template="header.cfm"> </head> <body> <div id="container"> <div class="hidden"><!-- the modal box container - this div is hidden until it is called from a modal box trigger. see cleanity.js for details --> <div id="sample-modal"><h2 style="font-size:160%; font-weight:bold; margin:10px 0;">Modal Box Content</h2><p>Place your desired modal box content here</p></div> </div><!-- end of hidden --> <!-- This section has the header and nav content in it--> <cfinclude template="nav_bar.cfm"> <div id="content"> <div id="mid-col"> <div class="box"> <h4 class="white">Edit <cfoutput>#select_record.tab_name#</cfoutput> Page</h4> <div class="box-container"> <!-- This <div> holds alert messages to be display in the sample page. --> <div id="alerts"> <noscript> <p> <strong>CKEditor requires JavaScript to run</strong>. In a browser with no JavaScript support, like yours, you should still see the contents (HTML data) and you should be able to edit it normally, without a rich editor interface. </p> </noscript> </div> <cfform action="html_edit_action.cfm" method="post" enctype="multipart/form-data" name="HTML_EDIT"> <!-- this is form is submitted automatically when the save button is presses in the editor--> Page Order: <input name="page_order" style="margin-bottom:8px;" type="text" id="page_order" value="<cfoutput>#select_record.page_order#</cfoutput>" size="4" maxlength="4" /> Page active: <input name="display_page" style="margin-bottom:8px;" type="checkbox" id="display_pagedisplay_page" value="checkbox" <cfif select_record.display_page eq "Yes">checked="checked"</cfif>/>Yes </li> <script type="text/javascript" src="../ckeditor/ckeditor.js"></script> <textarea cols="80" id="html" name="html" rows="10"><cfoutput>#select_record.html#</cfoutput></textarea> <script type="text/javascript"> //<![CDATA[ // This has to placed immediately after the text area CKEDITOR.replace( 'html', { //toolbar : 'Basic', contentsCss : 'ckeditor_custom.css', // make sure any changes to .css on front end are added here aswell //uiColor : '#9AB8F3', width : 970, height : 800, defaultLanguage : 'en-au', // this is the stuff required for ckfinder filebrowserBrowseUrl : '../ckfinder/ckfinder.html', filebrowserImageBrowseUrl : '../ckfinder/ckfinder.html?type=Images', filebrowserFlashBrowseUrl : '../ckfinder/ckfinder.html?type=Flash', filebrowserUploadUrl : '../ckfinder/core/connector/cfm/connector.cfm?command=QuickUpload&type=Files¤tFolder=/userfiles/files/', filebrowserImageUploadUrl : '../ckfinder/core/connector/cfm/connector.cfm?command=QuickUpload&type=Images¤tFolder=/userfiles/images/', filebrowserFlashUploadUrl : '../ckfinder/core/connector/cfm/connector.cfm?command=QuickUpload&type=Flash', filebrowserWindowWidth : '1000', filebrowserWindowHeight : '700' } ); //]]> </script> <input name="ID" type="hidden" id="ID" value="<cfoutput>#select_record.ID#</cfoutput>" /> </cfform> <p class="align-right">Last updated by <cfoutput>#select_record.last_changed_by#</cfoutput> on <cfoutput>#select_record.last_changed_date#</cfoutput></p> </div> </div> <div class="box"> <!-- end of div.box-container --> </div> <!-- end of div.box --> </div><!-- end of div#mid-col --> <!-- end of div#right-col --> <span class="clearFix"> </span></div> <!-- end of div#content --> <div class="push"></div> </div><!-- end of #container --> <div id="footer-wrap"> <cfinclude template="footer.cfm"> </div> </body> </html>
and my config.cfm page
<!--- ### CKFinder : Configuration File - Basic Instructions In a generic usage case, the following tasks must be done to configure CKFinder: 1. Check the baseUrl and baseDir variables. 2. If available, paste your license key in the "licenseKey" setting. 3. Create the CheckAuthentication() function that enables CKFinder for authenticated users. Other settings may be left with their default values, or used to control advanced features of CKFinder. ---> <cfscript> config = structNew(); // This function must check the user session to be sure that he/she is // authorized to upload and access files in the File Browser. ' function CheckAuthentication() { if ( structKeyExists(session, "IsAuthenticated") and session.IsAuthenticated ) { return true; } return true; } config.licenseName = ''; config.licenseKey = ''; /* To make it easy to configure CKFinder, the config.baseUrl and config.baseDir can be used. * Those are helper variables used later in this config file. * * config.baseUrl : the base path used to build the final URL for the resources handled * in CKFinder. If empty, the default value (/userfiles/) is used. * * Examples: * config.baseUrl = 'http://example.com/ckfinder/files/'; * config.baseUrl = '/userfiles/'; */ //ATTENTION: The trailing slash is required. /*config.baseUrl = "http://www.watsonscaravans.com.au/ckfinder/userfiles/";*/ /*config.baseUrl = "http://127.0.0.1:8500/watsonscaravans.com.au/new/ckfinder/userfiles/";*/ config.baseUrl = "http://127.0.0.1:8500/watsonscaravans.com.au/new/ckfinder/userfiles/"; /* * config.baseDir : the path to the local directory (in the server) which points to the * above config.baseUrl URL. This is the path used by CKFinder to handle the files in * the server. Full write permissions must be granted to this directory. * * Examples: * You may point it to a directory directly: * config.baseDir = '/home/login/public_html/ckfinder/files/'; * config.baseDir = 'C:/SiteDir/CKFinder/userfiles/'; * * Or you may let CKFinder discover the path, based on config.baseUrl: * config.baseDir = APPLICATION.CreateCFC("Utils.FileSystem").resolveUrl(config.baseUrl); */ //ATTENTION: The trailing slash is required. /*config.baseDir = "D:\hshome\krisf\watsonscaravans.com.au\new\ckfinder\userfiles\";*/ /*config.baseDir = "C:\ColdFusion8\wwwroot\watsonscaravans.com.au\new\ckfinder\userfiles\";*/ config.baseDir = "C:\ColdFusion8\wwwroot\watsonscaravans.com.au\new\ckfinder\userfiles\"; /* * Thumbnails : thumbnails settings. All thumbnails will end up in the same * directory, no matter the resource type. */ config.thumbnails = structNew(); config.thumbnails.url = config.baseUrl & '_thumbs'; config.thumbnails.baseDir = config.baseDir & '_thumbs'; config.thumbnails.enabled = true; config.thumbnails.directAccess = false; config.thumbnails.maxWidth = 100; config.thumbnails.maxHeight = 100; config.thumbnails.quality = 80; /* * set the maximum size of uploaded images * if uploaded image is larger, it gets scaled down * Set to 0 to disable this feature */ config.images.maxWidth = 800; config.images.maxHeight = 800; config.images.quality = 80; /* * config.roleSessionVar : the session variable name that CKFinder must use to retrieve * the "role" of the current user. The "role", can be used in the "AccessControl" * settings (bellow in this page). * * Note: to use session variables, session management must be enabled in Application.cfc. * In "core/connector/cfm" there is another Application.cfc file. * Assign the correct name of your application there. */ config.roleSessionVar = 'CKFinder_UserRole'; /* * config.accessControl : used to restrict access or features to specific folders. * * Many "config.accessControl" entries can be added. All attributes are optional. * Subfolders inherit their default settings from their parents' definitions. * * - The "role" attribute accepts the special '*' value, which means * "everybody". * - The "resourceType" attribute accepts the special value '*', which * means "all resource types". */ config.accessControl = arrayNew(1); config.accessControl[1] = structNew(); config.accessControl[1].role = '*'; config.accessControl[1].resourceType = '*'; config.accessControl[1].folder = '/'; config.accessControl[1].folderView = true; config.accessControl[1].folderCreate = true; config.accessControl[1].folderRename = true; config.accessControl[1].folderDelete = true; config.accessControl[1].fileView = true; config.accessControl[1].fileUpload = true; config.accessControl[1].fileRename = true; config.accessControl[1].fileDelete = true; config.accessControl[2] = structNew(); config.accessControl[2].role = '*'; config.accessControl[2].resourceType = 'Files'; config.accessControl[2].folder = '/'; config.accessControl[2].folderView = true; config.accessControl[2].folderCreate = true; config.accessControl[2].folderRename = true; config.accessControl[2].folderDelete = true; config.accessControl[2].fileView = true; config.accessControl[2].fileUpload = true; config.accessControl[2].fileRename = true; config.accessControl[2].fileDelete = true; /* * For example, if you want to restrict the upload, rename or delete of files in * the "Logos" folder of the resource type "Images", you may uncomment the * following definition, leaving the above one: * * config.accessControl[3] = structNew(); * config.accessControl[3].role = '*'; * config.accessControl[3].resourceType = 'Images'; * config.accessControl[3].folder = '/Logos'; * config.accessControl[3].fileUpload = false; * config.accessControl[3].fileRename = false; * config.accessControl[3].fileDelete = false; * * ResourceType : defines the "resource types" handled in CKFinder. A resource * type is nothing more than a way to group files under different paths, each one * having different configuration settings. * * Each resource type name must be unique. * * When loading CKFinder, the "type" querystring parameter can be used to display * a specific type only. If "type" is omitted in the URL, the * "DefaultResourceTypes" settings is used (may contain the resource type names * separated by a comma). If left empty, all types are loaded. * * maxSize is defined in bytes, but shorthand notation may be also used. * Available options are: G, M, K (case insensitive). * 1M equals 1048576 bytes (one Megabyte), 1K equals 1024 bytes (one Kilobyte), 1G equals one Gigabyte. * Example: * config.resourceType[1].maxSize = "2M"; */ config.defaultResourceTypes = ''; config.resourceType = arrayNew(1); config.resourceType[1] = structNew(); config.resourceType[1].name = 'Files'; config.resourceType[1].url = config.baseUrl & 'files'; config.resourceType[1].directory = config.baseDir & 'files'; config.resourceType[1].maxSize = '800K'; config.resourceType[1].allowedExtensions = '7z,aiff,asf,avi,bmp,csv,doc,docx,fla,flv,gif,gz,gzip,jpeg,jpg,mid,mov,mp3,mp4,mpc,mpeg,mpg,ods,odt,pdf,png,ppt,pptx,pxd,qt,ram,rar,rm,rmi,rmvb,rtf,sdc,sitd,swf,sxc,sxw,tar,tgz,tif,tiff,txt,vsd,wav,wma,wmv,xls,xlsx,zip'; config.resourceType[1].deniedExtensions = ''; config.resourceType[2] = structNew(); config.resourceType[2].name = 'Images'; config.resourceType[2].url = config.baseUrl & 'images'; config.resourceType[2].directory = config.baseDir & 'images'; config.resourceType[2].maxSize = '300K'; config.resourceType[2].allowedExtensions = 'bmp,gif,jpeg,jpg,png'; config.resourceType[2].deniedExtensions = ''; config.resourceType[3] = structNew(); config.resourceType[3].name = 'Flash'; config.resourceType[3].url = config.baseUrl & 'flash'; config.resourceType[3].directory = config.baseDir & 'flash'; config.resourceType[3].maxSize = 0; config.resourceType[3].allowedExtensions = 'swf,flv'; config.resourceType[3].deniedExtensions = ''; /* Due to security issues with Apache modules, it is recommended to leave the following setting enabled. How does it work? Suppose the following: - If "cfm" is on the denied extensions list, a file named foo.cfm cannot be uploaded. - If "rar" (or any other) extension is allowed, one can upload a file named foo.rar. - The file foo.cfm.rar has "rar" extension so, in theory, it can be also uploaded. In some conditions Apache can treat the foo.cfm.rar file just like any ColdFusion script and execute it. If checkDoubleExtension is enabled, each part of the file name after a dot is checked, not only the last part. In this way, uploading foo.cfm.rar would be denied, because "cfm" is on the denied extensions list. */ config.checkDoubleExtension = true ; /* * Perform additional checks for image files * if set to true, validate image size */ config.secureImageUploads = true ; /* Indicates that the file size (maxSize) for images must be checked only after scaling them. Otherwise, it is checked right after uploading. */ config.checkSizeAfterScaling = true ; /* For security, HTML is allowed in the first Kb of data for files having the * following extensions only. */ config.htmlExtensions = 'html,htm,xml,js' ; /* Folders to not display in CKFinder, no matter their location. No paths are accepted, only the folder name. The * and ? wildcards are accepted. */ config.hideFolders = arrayNew(1); config.hideFolders[1] = ".svn" ; config.hideFolders[2] = "CVS" ; /* Files to not display in CKFinder, no matter their location. No paths are accepted, only the file name, including extension. The * and ? wildcards are accepted. */ config.hideFiles = arrayNew(1); config.hideFiles[1] = ".*" ; /* Set it to false to disable uploading of the dot files * e.g. .htaccess, .ftpquota */ config.allowDotFiles = true; /* Due to known issues with GetTempDirectory function, it is * recommended to set this vairiable to a valid directory * instead of using the GetTempDirectory function */ config.tempDirectory = GetTempDirectory(); /* * After file is uploaded, sometimes it is required to change its permissions * so that it was possible to access it at the later time. * If possible, it is recommended to set more restrictive permissions, like 0755. * Set to 0 to disable this feature. * Note: not needed on Windows-based servers. * */ config.chmodFiles = 644; /* * See comments above. * Used when creating folders that does not exist. */ config.chmodFolders = 755; config.hooks = arrayNew(1); config.plugins = arrayNew(1); if (APPLICATION.CFVersion gte 8) { include("plugins/fileeditor/plugin.cfm"); include("plugins/imageresize/plugin.cfm"); // include("plugins/watermark/plugin.cfm"); } </cfscript>
Re: Coldfusion - Upload tab not working
Apologies for the late reply. Did you solve your problem already?
Please let me know and if not, I will check the problem on my side.
Wiktor Walc
CTO, CKSource - http://cksource.com
--
Follow CKEditor on: Twitter | Facebook | Google+