Raptor plugin options:
uriPublic
the URI to the public location of uploads (for links and image sources)uriAction
the URI for the file manager actionsuriIcon
the URI for file icons
Example:
$('.editable').raptor({
plugins: {
fileManager: {
uriPublic: '/uploads/',
uriAction: '/actions/file-manager.php',
uriIcon: '/file-manager/icon/'
}
}
});
File Manager options:
-
node
a DOM node to attach the file manager to -
uriAction
same as above -
<script type="text/javascript"> var rfm = new RFM({ node: document.getElementById('file-manager'), uriAction: '/actions/file-manager.php', uriIcon: '/file-manager/icon/' }); </script>uriIcon
same as above
Working standalone PHP example
node
same as aboves3
bucketURL
URL for you Amazon S3 bucketaccessKeyId
Amazon S3 access key IDpolicy
generated Amazon S3 policysignature
signature hash of policy and Amazon S3 secret
Example Amazon S3 credentials generation
<div id="file-manager"></div>
<script type="text/javascript">
var rfm = new RFM.S3({
node: document.getElementById('file-manager'),
s3: {
bucketURL: <?= json_encode($buckerUrl); ?>,
accessKeyId: <?= json_encode($accessKeyId); ?>,
policy: <?= json_encode($policy); ?>,
signature: <?= json_encode($signature); ?>
}
});
</script>
Working (without required credentials) Amazon S3 standalone example
Request parameters (GET):
action
must belist
path
current path to list (if subdirectories is supported)start
the start offsetlimit
amount of files to returnsort
the sort column:name
file namesize
file sizetype
file typemtime
file modified time
tags
comma separated list of tags to filter bysearch
search terms to filter by
Example request:
http://example.com/file-manager.php?action=list&path=%2F&start=0&limit=10&sort=mtime&direction=desc&tags=&search=
Response parameters:
start
same as requestlimit
same as requesttotal
total files in the current directoryfilteredTotal
total files in the current directory after applying filterstags
list of available tags to filter bydirectories
list of subdirectories in the current directoryfiles
list of files in the current directoryname
file nameattributes
custom attributestype
file typesize
file size (in bytes)mtime
file modified time (seconds since epoch)tags
list of tags for the file
Example response:
{
"start": "0",
"limit": 10,
"total": 21,
"filteredTotal": 21
"tags": [
"Image",
"Document",
...
],,
"directories": [
"some-directory",
"another-directory",
...
],
"files": [
{
"name": "foo.png",
"attributes": {
"alt": "Foo alt text"
},
"type": "png",
"size": 12748,
"mtime": 1402453369,
"tags": [
"Image"
]
},
{
"name": "bar.png",
"attributes": {
"alt": "Bar alt text"
},
"type": "png",
"size": 15500,
"mtime": 1402453369,
"tags": [
"Image"
]
},
...
]
}
Example PHP action to list files
Plupload is used to handle file uploads on the client side.
Request parameters:
action
must beupload
Examples:
Request parameters (POST):
action
must bedelete
path
path to file
Request parameters (POST):
action
must berename
path
path to filename
new file name
Specifying an icon end point allows the back end to resize images on demand.
Example Request:
http://example.com/file-manager/icons/foo.png
Example back end to resize icons:
Subdirectory support is still experimental.
Provided examples are not considered production ready. They lack basic authentication checks, and are not optimal for high load servers.