GetFiles"

This website contains links to software which is either no longer maintained or will be supported only until the end of 2019 (CKFinder 2). For the latest documentation about current CKSource projects, including software like CKEditor 4/CKEditor 5, CKFinder 3, Cloud Services, Letters, Accessibility Checker, please visit the new documentation website.

If you look for an information about very old versions of CKEditor, FCKeditor and CKFinder check also the CKEditor forum, which was closed in 2015. If not, please head to StackOverflow for support.

(New page: == GetFiles == Gets the list of files in a folder. === Sample Request === Get files from the /Docs/ folder of the resource type “Images”. <pre>connector.php?command=GetFiles&typ...)
 
Line 28: Line 28:
 
* mm&nbsp;: Minute (2 digits with padding zero)
 
* mm&nbsp;: Minute (2 digits with padding zero)
  
The “size” attribute is in Bytes.
+
<br>The “size” attribute is in kilobytes. If size is greater than 0 and less than 1024 bytes, return 1:
 +
<pre>if ($size &amp;&amp; $size&lt;1024) {
 +
$size = 1;
 +
}
 +
else {
 +
$size = (int)round($size / 1024);
 +
}</pre>
 +
(sample implementation in PHP)

Revision as of 15:25, 16 January 2008

GetFiles

Gets the list of files in a folder.

Sample Request

Get files from the /Docs/ folder of the resource type “Images”.

connector.php?command=GetFiles&type=Images&currentFolder=%2FDocs%2F

Sample Response

<?xml version="1.0" encoding="utf-8"?>
<Connector resourceType="Files">
 <Error number="0" />
 <CurrentFolder path="/" url="/userfiles/images/Docs/" acl="255" />
 <Files>
 <File name="File 1.jpg" date="200703280036" size="111" />
 <File name="Another.gif" date="200705192236" size="1588" />
 <File name="測試1.jpg" date="200703280015" size="35" />
 </Files>
</Connector>

Note that the file names may contain non ASC-II chars, like the following example with Chinese characters.

The “date” attribute correspond to the time of last file modification in the format YYYYMMDDHHmm, where:

  • YYYY : Year (4 digits)
  • MM : Month (2 digits with padding zero)
  • DD : Day (2 digits with padding zero)
  • HH : Hour (24 hours format - 2 digits with padding zero)
  • mm : Minute (2 digits with padding zero)


The “size” attribute is in kilobytes. If size is greater than 0 and less than 1024 bytes, return 1:

if ($size && $size<1024) {
 $size = 1;
}
else {
 $size = (int)round($size / 1024);
}

(sample implementation in PHP)