- remove filename ext from presentation name and convert all invalid chars to dash

git-svn-id: http://bigbluebutton.googlecode.com/svn/trunk@1359 af16638f-c34d-0410-8cfa-b39d5352b314
This commit is contained in:
Richard Alam 2009-05-01 21:31:17 +00:00
parent f109871e17
commit db6791911c
2 changed files with 9 additions and 7 deletions

View File

@ -90,10 +90,14 @@ package org.bigbluebutton.modules.presentation.view
LogUtil.debug("In startUpload()...")
var proxy:PresentProxy = facade.retrieveProxy(PresentProxy.NAME) as PresentProxy;
var presentationName:String = fileToUpload.name
var filenamePattern:RegExp = /(.+)(\.pdf)/i;
presentationName = presentationName.replace(filenamePattern, "$1")
trace(presentationName);
// Replace any character other than a word character (A-Z, a-z, 0-9, or _).
var presentationName:String = fileToUpload.name.replace(/[^0-9a-zA-Z_\.]/, "-");
proxy.uploadPresentation(presentationName, fileToUpload);
presentationName = presentationName.replace(/[^0-9a-zA-Z_\.]/g, "-");
trace(presentationName);
// proxy.uploadPresentation(presentationName, fileToUpload);
_fileWin.progBarLbl.visible = true;
_fileWin.progressBar.visible = true;

View File

@ -54,11 +54,9 @@
<mx:Label id="presentationNamesLb" text="Uploaded Presentations:" x="50" y="80"/>
<mx:ComboBox id="presentationNamesCombobox" width="125" x="190" y="80" dataProvider="{presentationNamesAC}"/>
<mx:Button id="deleteBtn" label="" toolTip="Delete Presentation"
click="deletePresentation()" enabled="true"
icon="@Embed('../assets/delete.png')" width="26" x="332" y="80"/>
click="deletePresentation()" enabled="true" icon="@Embed('../assets/delete.png')" width="26" x="332" y="80"/>
<mx:Button id="showBtn" label="Show" toolTip="Show Presentation"
click="showPresentation()" enabled="true"
icon="@Embed('../assets/bullet_go.png')" x="366" y="80"/>
click="showPresentation()" enabled="true" icon="@Embed('../assets/bullet_go.png')" x="366" y="80"/>
<mx:Label id="progBarLbl" text="Progress:" x="21" y="67" visible="false"/>
<mx:ProgressBar id="progressBar" mode="manual" label="" labelPlacement="center" width="360" y="67" x="87" visible="false"/>