Line 6: | Line 6: | ||
The FileSize plugin should provide a new command named "FileSize", in other words, calling: | The FileSize plugin should provide a new command named "FileSize", in other words, calling: | ||
+ | <code> | ||
/ckfinder/core/connector/{{{ext}}}/connector.{{{ext}}}?command=FileSize&type=Files¤tFolder=%2F&fileName=foobar.jpg | /ckfinder/core/connector/{{{ext}}}/connector.{{{ext}}}?command=FileSize&type=Files¤tFolder=%2F&fileName=foobar.jpg | ||
+ | </code> | ||
(assuming that foobar.jpg exists) | (assuming that foobar.jpg exists) | ||
should return a valid XML response: | should return a valid XML response: |
Revision as of 09:34, 25 May 2010
Sample plugin: FileSize (adding new server side command - complete example)
Introduction
Probably the best way to learn new things is to write a code, so let's write a plugin that adds a new server side command to the connector. We'll create a command that returns a size of a given file.
The FileSize plugin should provide a new command named "FileSize", in other words, calling:
/ckfinder/core/connector/{{{ext}}}/connector.{{{ext}}}?command=FileSize&type=Files¤tFolder=%2F&fileName=foobar.jpg
(assuming that foobar.jpg exists)
should return a valid XML response:
<Connector resourceType="Files"> <Error number="0"/> <CurrentFolder path="/" url="/ckfinder/userfiles/files/" acl="255"/> <FileSize size="5647"/> </Connector>