Friday, October 5, 2012

CKFinder for Domino. Images (and Files)

CKFinder open an image in the same way as a thumbnail. So we have exactly the same problem like for thumbnails in Domino.

CKFinder construct link to the file like "base-file-url\filename". In Domino, we have access to the attachment with the help of "\$file\" path. So we must to have URL like:
"base-file-url\filename\$file\filename." or "base-file-url\filename\filename" in the case of substitution.

You need to find in the ckfinder.js string like
J.push('<a href="', D.folder.getUrl(), 
'" title="', C[K].name, '" rel="', E, '">a</a>'); 
and change it with
if (!F || F(C[K])) {   
 var filename = encodeURIComponent(C[K].name);
 var basenanme = filename.substring(0, 
 var url = D.folder.getResourceType().url 
  + basenanme+'/$file/'+filename;
 J.push('<a href="', url, '" title="', C[K].name, 
  '" rel="', E, '">a</a>');                    
 if (C[K].isSameFile(D)) H = I;
That will change image url. You also need to change File url. Find
if (! + 
 encodeURIComponent(, '_blank', V)) 
 R.msgDialog('', R.lang.ErrorMsg.oo);

and change it with

var filename = encodeURIComponent(;
var basenanme = filename.substring(0, filename.lastIndexOf('.'));
var url = S.folder.getResourceType().download + basenanme+
if (!, '_blank', V)) 
 R.msgDialog('', R.lang.ErrorMsg.oo);

No comments: