Attachments
Access
{{reader}}
Favourite Pages
{{pageEntry.pageName}}
Signed in as {{currentUser}} {{avatar}}
Sign Out
Sign In as Different User
{{currentUserExtraOptions}}
OpenForum
Actions
Attachments
//OpenForum/Actions/Attachments/get.sjs
var targetPage = transaction.getParameter("pageName"); var matching = transaction.getParameter("matching"); if(targetPage===null) { transaction.setResult(transaction.SHOW_PAGE); return; } targetPage = ""+ targetPage; var list = file.getAttachmentsForPage(targetPage); var metaData = transaction.getParameter("metaData"); var attachments = js.getObject("/OpenForum/Actions/Attachments","Attachments.sjs"); var items = attachments.getList(targetPage,matching); var data = {attachments: [], length: items.length, pageName: targetPage}; var totalSize = 0; var lastModified = 0; for(var index in items) { var fileName = items[index]; var entry = {pageName: targetPage, fileName: fileName}; if(metaData!==null) { try{ entry.lastModified = parseInt( file.getAttachmentTimestamp(targetPage,fileName),10 ); entry.size = parseInt( file.getAttachmentSize(targetPage,fileName),10 ); totalSize += entry.size; if(lastModified===0 || lastModified
An error has occurred.
{{OpenForum.errorMessage}}
See technical details
×
Error details.
{{OpenForum.error}}
×
{{OpenForum.alert.title}}
{{OpenForum.alert.message}}
×