Get Action Creates a play list of all mp3 files attached to a page.

Parameters

Usage:

/OpenForum/Actions/CreateM3UFile.m3u?pageName=MyAlbum

Server Side Javascript for GET method

if(typeof(pageName)=="undefined") { transaction.setResult(transaction.SHOW_PAGE); } else { files = file.getAttachmentsForPage(pageName); data = ""; enumerator = files.keys(); while(enumerator.hasMoreElements()) { fileName = enumerator.nextElement(); if(fileName.indexOf("._")==0) { continue; } if(fileName.toLowerCase().indexOf(".mp3")!=-1) { data += "http://127.0.0.1/"+pageName+"/"+fileName+"\n"; } } arrayHelper = js.getStringArrayHelper(); tunes = arrayHelper.parseFields(data,'\n'); tunes = arrayHelper.sort(tunes,arrayHelper.ASCENDING); data = arrayHelper.arrayToString(tunes,"\n"); transaction.sendPage(data,"m3u"); }