page.files()
Purpose
Method page.files() retrieves meta data about all attached files, e. g. name, URL, file size, when uploaded, MIME type, description and comment.
Syntax
page.files({'site': 'site-name', 'page': 'page-name'})
Arguments
- site-name
- the name of the site, from which information about files attached to page-name should be retrieved
- page-name
- the unix name (including its category) of the page for which information about attached pages should be retrieved
Returns
Meta data about files attached to the page is returned as a list of dictionaries with the following keys:
- 'name'
- the file name including extension
- 'url'
- The full URL http://site-name.wikidot.com/local--files/page-name/file-name
- 'size'
- the file size as listed in the file's File Information pop-up
- 'date-added'
- the file's upload date as listed in the file's File Information pop-up
- 'mime'
- the file's MIME type as listed in the file's File Information pop-up
- 'description'
- the content type as listed in the file's File Information pop-up
- 'comment'
- Any comment that has been specified as “File comment:” during upload; otherwise a null string ('')
Note that the files are returned in an arbitrary order. To sort the returned list, see the Sort Returned Data snippet.
Example
The example assumes that s is a successfully authenticated ServerProxy object.
What you type … | What you get … |
s.page.files({'site': 'xml-api', 'page': 'doc:scripts'}) |
[{'comment': '',
'name': 'api_pages_csv.py',
'url': 'http://xml-api.wikidot.com/local--files/doc:scripts/api_pages_csv.py',
'mime': 'text/x-java; charset=us-ascii',
'date_added': '2009-04-16T22:06:01+00:00',
'size': '3155',
'description': 'ASCII Java program text, with CRLF line terminators'}
]
|