|
Table Of Contents
|
Using PFU with your Forms
To submit a form after ProflashUpload is finished, you can just use the jsOnComplete to submit the form on the page after the upload.
However the recommend wat to integrate integrate PFU with a form is to: 1. Remember the list of uploaded files in a session variable. fileListVariable="uploadFilesList". 2. Hide the upload built-in Upload button. ie showUploadButton="no". 3. Start the upload when the form is submitted - see javascript example below. 4. Use the OnComplete javascript callback to submit the form after the upload. ie jsOnComplete="functionName". Some sample code: <cf_dccom component="ProFlashUpload" width="100%" height="#REQUEST.height#" folder="#REQUEST.uploadPath#" jsOnComplete="files.OnFileUploadComplete" showUploadButton="no" nameconflict="makeunique" fileListVariable="uploadedFilesList" originalNameFileListVariable="uploadedFileFiles_OriginalNames" maxTotalFileSize="#ROUND(cMaxTotalFileSizeAllowed/1024)#" displaymode="noscript" maxFiles="#REQUEST.maxFiles#" maxFileSize="#REQUEST.maxFileSize#" blockExtensions="asp,aspx" ></cf_dccom> <script language="JavaScript1.2"> function onSubmitForm(){ var flash; if(navigator.appName.indexOf("Microsoft") != -1) { flash = window.ProFlashUpload1; }else { flash = window.document.ProFlashUpload1; } try{ flash.upload(); } catch(e){ alert("Upload didn't work"); } } </script> Note: Do not place PFU with a <form></form> tag as flash doesn't like this. Examples of PFU integration can be seen on our flagship product Teamwork Project Manager. |