Attach
Access
{{reader}}
Favourite Pages
{{pageEntry.pageName}}
Signed in as {{currentUser}} {{avatar}}
Sign Out
Sign In as Different User
{{currentUserExtraOptions}}
OpenForum
Actions
Attach
Post Action
Server Side Javascript for POST method
//OpenForum/Actions/Attach/post.sjs
try{ xmlHeader = transaction.getPostFileData(); fileName = transaction.getPostParameter("fileName"); pageName = transaction.getParameter("page"); transaction.userCanPerformAction(pageName,"update",true); transaction.confirmPostAttachment(xmlHeader); user = transaction.getUser(); wiki.addJournalEntry("File ["+pageName+"/"+fileName+"] added to Page ["+pageName+"] by "+user); page = wiki.buildPage(pageName); //transaction.goToPage(pageName); transaction.sendJSON( JSON.stringify({result: "ok",message: "Uploaded: "+fileName})); } catch(e) { transaction.sendJSON( JSON.stringify({result: "error",message: "Error: "+e})); }
An error has occurred.
{{OpenForum.errorMessage}}
See technical details
×
Error details.
{{OpenForum.error}}
×
{{OpenForum.alert.title}}
{{OpenForum.alert.message}}
×