This shows you the differences between two versions of the page.
Next revision | Previous revision | ||
dev:sapi:get_dir [2022/04/20 16:15] – created vikki | dev:sapi:get_dir [2022/04/20 18:08] (current) – [fields] vikki | ||
---|---|---|---|
Line 3: | Line 3: | ||
====== GetDir ====== | ====== GetDir ====== | ||
- | **Script path: | + | **Script path: |
- | **Description: | + | **Description: |
- | **INPUT (via GET or POST)** | + | ---- |
- | Mandatory parameters are: **sid**, **path**\\ | + | ===== INPUT (via GET or POST) ===== |
- | Optional parameters are: **fields**, **filter**, **sortby**, **sorthow**, | + | |
- | ^sid|session | + | Mandatory parameters are: **sid, path**\\ |
- | ^path|path to a folder. [mandatory]\\ | + | Optional parameters are: **fields, filter, sortby, sorthow, ofmt** |
- | ^fields|= name, | + | |
+ | |||
+ | ==== sid ==== | ||
+ | Session | ||
+ | |||
+ | |||
+ | ==== path ==== | ||
+ | Path to a folder. [mandatory]\\ | ||
+ | Please refer to [[dev: | ||
+ | |||
+ | Path must point to an existing folder. E.g.: | ||
+ | * < | ||
+ | * < | ||
+ | * < | ||
+ | |||
+ | ==== fields | ||
+ | = name, | ||
+ | = name, | ||
+ | |||
+ | The field names may be any order and the returned field values will follow that order. Separate the field names with commas but do not include any spaces. Fields obmitted will not be returned. Returned value for a field can be empty strings. If a field does not exist in the item's information record, an empty field is returned. WARNING: a misspelled field name will be quietly ignored, i.e. returned empty value! | ||
+ | |||
+ | * **name** is the name of the item | ||
+ | * **date** is in 14-digit form, corrected to user's localtime using the user's timezone info from his profile. e.g. 20010130052533 | ||
+ | * **dategmt** is in 14-digit form, GMT time. e.g. 20010129212533 is the GMT equivalent to the date example. | ||
+ | * **mtime** is the number of non-leap seconds since 1 Jan 1970 GMT. mtime is in GMT. | ||
+ | * **size** is the file size. Integer, no commas. For folders, it is the total size of all files and subfolder under it, BUT it can be -1 or " | ||
+ | * **type** is a string ' | ||
+ | * **owner** is the owner of the item, taking the form of < | ||
+ | * **company** is the organization of owner, taking the form of [< | ||
+ | * **lock** is the lock status of the item. Value is ' | ||
+ | * **description** is a string entered by owner to describe the item. | ||
+ | * **checksum** is the 128-bit MD5 checksum of the file represented as lowercased 32 hex digits. This only applies to files. WARNING: For folders, the value returned will be empty/null, without any errors being flagged. | ||
+ | * **lock_owner** is the lock owner for a lock placed on the item. Value is in the form of and " | ||
+ | |||
+ | ==== filter ==== | ||
+ | = pattern(s) to match\\ | ||
+ | List only items with name matching pattern using wild cards, *, ? and []\\ | ||
+ | The match is done case-insensitive. Example:\\ | ||
+ | * < | ||
+ | * < | ||
+ | * < | ||
+ | * < | ||
+ | * < | ||
+ | |||
+ | Multiple patterns are specified with comma separating them, example, *.jpeg, | ||
+ | |||
+ | |||
+ | ==== sortby ===== | ||
+ | name | size | date | mtime\\ | ||
+ | = name (sort by name is the default) | ||
+ | |||
+ | The listing will be sorted by the field specified. Since ' | ||
+ | |||
+ | |||
+ | ==== sorthow ==== | ||
+ | = ascend | descend\\ | ||
+ | = ascend (sort by ascending manner by default) | ||
+ | |||
+ | |||
+ | ==== ofmt ==== | ||
+ | = null | json | jsonp | ||
+ | |||
+ | * null is the default, and the legacy " | ||
+ | * json means the output format is in JSON format | ||
+ | * jsonp is like json, but in " |