Code Index

Namespaces

Classes


Class CKFinder.dataTypes.File

Class Summary
Constructor Attributes Constructor Name and Description
 
CKFinder.dataTypes.File(name, size, thumb, date, dateF, folder, acl, custom)
File data type.
Field Summary
Field Attributes Field Name and Description
 
Object holding custom attributes send from server in XML response.
 
Date (modification time).
 
Date (modification time, formatted).
 
ext
File extension.
 
Folder where file belongs to.
 
File's number in the files array.
 
Boolean flag indicating whether files was deleted.
 
File name.
 
File name (lowercased).
 
Object holding names of predefined properies for File object.
 
Size of a file (in kilobytes).
 
Name of a thumbnail file (set only when directAccess to thumbnails is enabled).
Method Summary
Method Attributes Method Name and Description
 
Returns an <a> element that displays a file.
 
blur()
 
deselect(keepOthers)
Deselects a file.
 
Returns CKFinder DOM element that displays file name.
 
focus(multiple, noSelect)
 
 
getThumbnailUrl(addHash)
Returns a complete url to a thumbnail.
 
Returns url to a file.
 
Checks whether file is an image.
 
isSameFile(file)
Checks whether file and given file is equal.
 
 
Deletes (physically) a file from the server.
 
rename(name)
Renames file (on a server) to a given name.
 
Returns an element responsible for displaying a file.
 
select(multiple)
Selects a file.
 
Returns string represantation of a file.
Class Detail
CKFinder.dataTypes.File(name, size, thumb, date, dateF, folder, acl, custom)
Since: 2.0
File data type.
Note: the CKFinder.dataTypes namespace is not directly accessible (CKFinder.dataTypes is undefined).
Data types are used internally by CKFinder and returned by many functions, like CKFinderAPI#getSelectedFile.
alert( api.getSelectedFile().name );
Parameters:
{Undefined} name
{Undefined} size
{Undefined} thumb
{Undefined} date
{Undefined} dateF
{Undefined} folder
{Undefined} acl
{Undefined} custom
Field Detail
{Object} custom
Since: 2.0
Object holding custom attributes send from server in XML response.

{String} date
Since: 2.0
Date (modification time).
201103181908

{String} dateF
Since: 2.0
Date (modification time, formatted).
3/18/2011 7:08 PM

{String} ext
Since: 2.0
File extension.
jpg

{CKFinder.dataTypes.Folder} folder
Since: 2.0
Folder where file belongs to.

{Integer} index
Since: 2.0
File's number in the files array.
NO EXAMPLE AVAILABLE

{Boolean} isDeleted
Since: 2.0
Boolean flag indicating whether files was deleted.

{String} name
Since: 2.0
File name.
Foo.jpg

{String} nameL
Since: 2.0
File name (lowercased).
foo.jpg

{Object} predefinedProperties
Since: 2.0
Object holding names of predefined properies for File object.
NO EXAMPLE AVAILABLE

{Integer} size
Since: 2.0
Size of a file (in kilobytes).
432

{String} thumb
Since: 2.0
Name of a thumbnail file (set only when directAccess to thumbnails is enabled).
alert( api.getSelectedFile().thumb );
Method Detail
{CKFinder.dom.element} aNode()
Since: 2.0
Returns an <a> element that displays a file.
var file = api.getSelectedFile();
file.aNode().appendHtml('(sample text)');
Returns:
{CKFinder.dom.element} <a> element that contains a file.

{Undefined} blur()
Since: 2.0
NO EXAMPLE AVAILABLE

{Undefined} deselect(keepOthers)
Since: 2.0
Deselects a file.
Parameters:
{Undefined} keepOthers

{CKFinder.dom.element} filenameNode()
Since: 2.0
Returns CKFinder DOM element that displays file name.
var file = api.getSelectedFile();
alert(file.filenameNode().$.innerHTML);
Returns:
{CKFinder.dom.element} Dom element.

{Undefined} focus(multiple, noSelect)
Since: 2.0
NO EXAMPLE AVAILABLE
Parameters:
{Undefined} multiple
{Undefined} noSelect

{Undefined} focusNode()
Since: 2.0
NO EXAMPLE AVAILABLE

{String} getThumbnailUrl(addHash)
Since: 2.0
Returns a complete url to a thumbnail.
var file = api.getSelectedFile();
alert( file.getThumbnailUrl() );
Parameters:
{Boolean} addHash
Whether to append hash code at the end of url.
Returns:
{String} Thumbnail url.

{String} getUrl()
Since: 2.0
Returns url to a file.
api.openMsgDialog( api.getSelectedFile().getUrl() );
Returns:
{String} Url to a file.

{Boolean} isImage()
Since: 2.0
Checks whether file is an image.
// true for file.jpg, file.png etc.
alert( api.getSelectedFile().isImage() );
Returns:
{Boolean} True if image extension indicates that the file is an image.

{Boolean} isSameFile(file)
Since: 2.0
Checks whether file and given file is equal.
NO EXAMPLE AVAILABLE
Parameters:
{CKFinder.dataTypes.File} file
File object.
Returns:
{Boolean} True if files are euqal.

{Undefined} releaseDomNodes()
Since: 2.0
NO EXAMPLE AVAILABLE

{Undefined} remove()
Since: 2.0
Deletes (physically) a file from the server.

{Undefined} rename(name)
Since: 2.0
Renames file (on a server) to a given name.
Parameters:
{String} name
New file name.

{Undefined} rowNode()
Since: 2.0
Returns an element responsible for displaying a file.
var file = api.getSelectedFile();
file.rowNode().hide();
Returns:
{Undefined} CKFinder.dom.element

{Undefined} select(multiple)
Since: 2.0
Selects a file.
Parameters:
{Undefined} multiple

{String} toString()
Since: 2.0
Returns string represantation of a file.
Returns:
{String} Name of a file.

Copyright © 2007-2015, CKSource - Frederico Knabben. All rights reserved.