Hi
I'm using CKfinder and I'm trying to get the file thumbnail url rather than the fileurl does anyone know how exactly to pull this through.
I found this but I can't figure out how to implement it correctly
I tried this
I'm using CKfinder and I'm trying to get the file thumbnail url rather than the fileurl does anyone know how exactly to pull this through.
function BrowseServer()
{
// You can use the "CKFinder" class to render CKFinder in a page:
var finder = new CKFinder();
finder.basePath = '../'; // The path for the installation of CKFinder (default = "/ckfinder/").
finder.selectActionFunction = SetFileField;
finder.popup();
//StartupPath = 'Images:/images/';
// It can also be done in a single line, calling the "static"
// popup( basePath, width, height, selectFunction ) function:
// CKFinder.popup( '../', null, null, SetFileField ) ;
//
// The "popup" function can also accept an object as the only argument.
// CKFinder.popup( { basePath : '../', selectActionFunction : SetFileField } ) ;
}
// This is a sample function which is called when a file is selected in CKFinder.
function SetFileField( fileUrl )
{
document.getElementById( 'imagethumb' ).value = fileUrl;
document.getElementById('imagedisplay').src = fileUrl;
}
I found this but I can't figure out how to implement it correctly
function ShowFileInfo( fileUrl, data )
{
alert( 'The selected file URL is "' + fileUrl + '"' ) ;
var formatDate = function( date ) {
return date.substr(0,4) + "-" + date.substr(4,2) + "-" + date.substr(6,2) + " " + date.substr(8,2) + ":" + date.substr(10,2) ;
}
alert( 'The selected file URL is: "' + data['fileUrl'] + '"' ) ;
alert( 'The size of selected file is: "' + data['fileSize'] + 'KB"' ) ;
alert( 'The selected file was last modifed on: "' + formatDate( data['fileDate'] ) + '"' ) ;
alert( 'The data passed to the function is: "' + data['selectFunctionData'] + '"' ) ;
}
I tried this
function BrowseServer()
{
// You can use the "CKFinder" class to render CKFinder in a page:
var finder = new CKFinder();
finder.basePath = '../'; // The path for the installation of CKFinder (default = "/ckfinder/").
finder.selectActionFunction = SetFileField;
//added line
finder.SelectThumbnailFunction = ShowFileInfo;
finder.popup();
//StartupPath = 'Images:/images/';
}
