Jump to content

CKfinder thumbnail


beanymanuk

Recommended Posts

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.

 

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;
}

Link to comment
Share on other sites

I have found this function but I cant get it working

http://docs.cksource.com/CKFinder_2.x/SelectFunction

 

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'] + '"' ) ;
}

 

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/';

}

 

 

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.