If I understand the documentation for CKFinder I should be able to leave out the QueryString value type from the filebrowserUploadUrl parameter and it will default to all defined Resource Types (built in plus those defined in the config file).
What I would like to do is use filebrowserUploadUrl to upload pdf's or Microsoft docs to separate paths. I thought I had everything setup properly but CKFinder keeps throwing an error telling the the requested resource in invalid. Heres the snippet from the config.asp file (sorting this out in a Classic ASP environment):
---------------------------------------------------------------------------------------------------------------
CKFinder_Config.Add "DefaultResourceTypes", ""
Dim ResourceTypes(4)
Set ResourceTypes(0) = DefineResourceType("Files", baseUrl & "MiscFiles", baseDir & "MiscFiles", 0, "csv,txt,rtf,zip,pdf", "")
Set ResourceTypes(1) = DefineResourceType("Images", baseUrl & "Images", baseDir & "Images", 0, "bmp,gif,jpeg,jpg,png", "")
Set ResourceTypes(2) = DefineResourceType("Flash", baseUrl & "Flash", baseDir & "Flash", 0, "swf,flv", "")
Set ResourceTypes(3) = DefineResourceType("PDFs", baseUrl & "PDF", baseDir & "PDF", 0, "pdf", "")
Set ResourceTypes(4) = DefineResourceType("MSDocs", baseUrl & "MSOffice", baseDir & "MSOffice", 0, "doc,docx,ppt,pptx,rtf,xls,xlsx", "")
CKFinder_Config.Add "ResourceType", ResourceTypes
---------------------------------------------------------------------------------------------------------------
and heres the call that sets up the CKEditor and CKFinder on the web page :
<script type="text/javascript" src="/cgi-bin/Java_Script/CKEditor/ckeditor.js"></script>
<script type="text/javascript" src="/cgi-bin/Java_Script/CKFinder/ckfinder.js"></script>
<script type="text/javascript">
if ( typeof CKEDITOR == 'undefined' ) {
document.write('<strong><span style="color: #ff0000">Error</span>: CKEditor not found</strong>. Please check BasePath values');
} else {
CKEDITOR.replace( 'addNewsTArea0',
{
filebrowserBrowseUrl : '/cgi-bin/Java_Script/CKFinder/ckfinder.html',
filebrowserImageBrowseUrl : '/cgi-bin/Java_Script/CKFinder/ckfinder.html?type=Images',
filebrowserFlashBrowseUrl : '/cgi-bin/Java_Script/CKFinder/ckfinder.html?type=Flash',
filebrowserUploadUrl : '/cgi-bin/Java_Script/CKFinder/core/connector/asp/connector.asp?command=QuickUpload¤tFolder=/Editorial/',
filebrowserImageUploadUrl : '/cgi-bin/Java_Script/CKFinder/core/connector/asp/connector.asp?command=QuickUpload&type=Images¤tFolder=/Editorial/',
}
);
}
</script>
------------------------------------------------------------------------------------------------------------------------
So I thought because I setup the new resource types PDFs and MSDocs and then used filebrowserUploadUrl leaving off the type value from the querystring that CKFinder would pull the global default values from CKFinder_Config.Add "DefaultResourceTypes", "" in the config file, and since that value was empty it would proceed to pull all resources types as valid types which meant the built in plus my new defines. Then it would see the currentFolder variable in the querystring and drop them in the appropriate subfolders of the new resource types.
Any ideas where I went wrong?
What I would like to do is use filebrowserUploadUrl to upload pdf's or Microsoft docs to separate paths. I thought I had everything setup properly but CKFinder keeps throwing an error telling the the requested resource in invalid. Heres the snippet from the config.asp file (sorting this out in a Classic ASP environment):
---------------------------------------------------------------------------------------------------------------
CKFinder_Config.Add "DefaultResourceTypes", ""
Dim ResourceTypes(4)
Set ResourceTypes(0) = DefineResourceType("Files", baseUrl & "MiscFiles", baseDir & "MiscFiles", 0, "csv,txt,rtf,zip,pdf", "")
Set ResourceTypes(1) = DefineResourceType("Images", baseUrl & "Images", baseDir & "Images", 0, "bmp,gif,jpeg,jpg,png", "")
Set ResourceTypes(2) = DefineResourceType("Flash", baseUrl & "Flash", baseDir & "Flash", 0, "swf,flv", "")
Set ResourceTypes(3) = DefineResourceType("PDFs", baseUrl & "PDF", baseDir & "PDF", 0, "pdf", "")
Set ResourceTypes(4) = DefineResourceType("MSDocs", baseUrl & "MSOffice", baseDir & "MSOffice", 0, "doc,docx,ppt,pptx,rtf,xls,xlsx", "")
CKFinder_Config.Add "ResourceType", ResourceTypes
---------------------------------------------------------------------------------------------------------------
and heres the call that sets up the CKEditor and CKFinder on the web page :
<script type="text/javascript" src="/cgi-bin/Java_Script/CKEditor/ckeditor.js"></script>
<script type="text/javascript" src="/cgi-bin/Java_Script/CKFinder/ckfinder.js"></script>
<script type="text/javascript">
if ( typeof CKEDITOR == 'undefined' ) {
document.write('<strong><span style="color: #ff0000">Error</span>: CKEditor not found</strong>. Please check BasePath values');
} else {
CKEDITOR.replace( 'addNewsTArea0',
{
filebrowserBrowseUrl : '/cgi-bin/Java_Script/CKFinder/ckfinder.html',
filebrowserImageBrowseUrl : '/cgi-bin/Java_Script/CKFinder/ckfinder.html?type=Images',
filebrowserFlashBrowseUrl : '/cgi-bin/Java_Script/CKFinder/ckfinder.html?type=Flash',
filebrowserUploadUrl : '/cgi-bin/Java_Script/CKFinder/core/connector/asp/connector.asp?command=QuickUpload¤tFolder=/Editorial/',
filebrowserImageUploadUrl : '/cgi-bin/Java_Script/CKFinder/core/connector/asp/connector.asp?command=QuickUpload&type=Images¤tFolder=/Editorial/',
}
);
}
</script>
------------------------------------------------------------------------------------------------------------------------
So I thought because I setup the new resource types PDFs and MSDocs and then used filebrowserUploadUrl leaving off the type value from the querystring that CKFinder would pull the global default values from CKFinder_Config.Add "DefaultResourceTypes", "" in the config file, and since that value was empty it would proceed to pull all resources types as valid types which meant the built in plus my new defines. Then it would see the currentFolder variable in the querystring and drop them in the appropriate subfolders of the new resource types.
Any ideas where I went wrong?
Re: Problem with Adding New Resource Types for QuickUpload
In the QuickUpload you must specify correctly where do you want the file to be uploaded, if you don't specify what type of resource you want to upload then it can't verify paths, permissions...
Re: Problem with Adding New Resource Types for QuickUpload
filebrowserUploadUrl
filebrowserImageUploadUrl
filebrowserFlashUploadUrl
If I have already defined ImageUpload with a destination folder and filebrowserFlashUploadUrl
with another destination folder then the only method left for all other file types is filebrowserUploadUrl yes?My goal would be to have flash objects sent to one folder, images sent to another, MSDocs sent to another, PDF's sent to another, and all others sent to a Misc folder.
Thats five folders, but I can only define three folders using the three methods above (on a given web page) right? So my best solution would be to send images to one folder, flash to another, and all others to the third? Or is there a way to define the upload destination folder in CKFinder for a file based on file type that Im missing?
Re: Problem with Adding New Resource Types for QuickUpload