Skip to main content
Inspiring
August 6, 2009
Question

Progress Bar doesnt show

  • August 6, 2009
  • 1 reply
  • 1427 views

why doesnt progress bar show on ie/ns?....Thank you all.

<cfif isdefined('form.Process') and form.process eq "Process" and isdefined('Form.rosterfile') and form.rosterfile neq "">
<cfset CurrDir = GetDirectoryFromPath(GetTemplatePath())>
  <cfset StorageDir = GetDirectoryFromPath(GetTemplatePath()) & "Storage\">
      <div id="display_while_running">
         <table align="center" border="0" cellpadding="0" cellspacing="0" style="border:solid 1px green; background : #backgroundcolor1#; width:600px;padding:5px; text-align:center;">
          <tr>
            <td >
              <b>Please wait while it is processing...</b>
            </td>
          </tr>
          <tr>
            <td>
             <img src="../imgs/progressbar2.gif" width="250" height="20">
            </td>
          </tr>
        </table>
      </div>
        
    <!---CFOUTPUT>#RepeatString(" ",300)#</CFOUTPUT--->
     
      <!---cfflush--->
       
      <cffile action="upload"
      destination="#StorageDir#"
      nameConflict="overwrite"
      fileField="Form.rosterfile">
      <cfset strFilePath ="#StorageDir##cffile.serverFile#">
      <cfset strFile ="#cffile.serverFile#">
     
      <cfquery datasource="#application.Orc#" name="GetFileName">  
        Select FILE_NAME from ops$rms.HR_File
        where
        lower(file_name) = lower('#strFile#')
     </cfquery>
            
    <cfif GetFileName.recordcount neq 0>
      <cfset msg = "This file has been already uploaded. Please upload a different one.">
    <cfelse>
        <cfflush interval="10">
    

        <cfset CurrFilePath ="#CurrDir##cffile.serverFile#">
       
        <cffile action = "copy" source="#strFilePath#" destination="#CurrDir#">
        <cffile action="rename" source="#CurrFilePath#" destination="#CurrDir#HrXls.xls">
                  
        <cflock name="xlsloader" timeout="300" type="exclusive">

              <cfset command = "java RMSHRFileReader C:\Inetpub\wwwroot\RMS\hr_loader\HrXls.xls">
              <cfset syscmd = createObject("java","au.com.webcode.util.SystemCommand").init()>
              <cfset result = syscmd.execute(command,"300000")> <!---5 mins, must be a string--->
              <cfif result.getExitValue() neq 0>
               <cfset msg = "The uploading process has been partially completed.">
       </cfif>
        </cflock>
       
        <cfquery datasource="#application.Orc#" name="InsFileName">
          insert into ops$rms.HR_File(file_name, updated_on, updated_by)
          values('#strFile#',SYSDATE,'#session.username#')
        </cfquery>
       
        <cfset stdout = 1> 
        <cffile action = "delete" file="#CurrDir#HrXls.xls">
    </cfif>
    
  <script language="Javascript">
      document.getElementById('display_while_running').style.display='none';
    </script>
          

</cfif>

This topic has been closed for replies.

1 reply

Participating Frequently
August 10, 2009

Because ColdFusion code starts executing after the contents of the

file to be uploaded is received by the server. In other words when

you're trying to show the progress bar there's no need for a progress

bar because the upload is at 100%.

Mack

emmim44Author
Inspiring
August 10, 2009

Even when i place withing else statement which invokes a java excel reader doesnt show.... what is the solution? Thank you.

Participating Frequently
August 10, 2009

The progress bar problem doesn't have an easy solution in CF. You can

use a flash uploaded that gives you a progress bar (swfupload.org

comes to mind).

Mack