7 Replies Latest reply on Sep 7, 2014 6:32 AM by BKBK

    please Help me in solving this issue. i am a newbie to coldfusion

    DharameshShrivastava Level 1

      i want to use a single home page where i will show a form (which is in another file) to user to upload a file,after uploading (action file result) i want to show result of upload also on the same page.

      these are my three files:

       

      1. index.cfm

      <!-- start -->

      <html>

      <head>

      <title>HomePage</title>

      <cfajaximport tags="CFFORM">

      </head>

      <body>

      <cfdiv id="Main" style="width:1000px; height:600px" >

              <cfdiv id="Options" style=" width:100%;height:20%" >

                  Welcome Admin, <a href="javascript:ColdFusion.navigate('FileUpload.cfm','Content')" class="settings">Update  </a><a href="#" class="logout">Logout</a>

              </cfdiv>

       

              <cfdiv id="Content" style=" width:100%;height:80%">

      <h2>Here Goes Form and FileUploading</h2>

              </cfdiv>

      </cfdiv>

      </body>

      </html>

      <!--  -->

       

      2.FileUpload.cfm

       

      <!-- start -->

      <html>

          <head>

              <title>

                  Upload A File

              </title>

          </head>

          <body >       

      <cflayout type="vbox" name="layout1">

      <cflayoutarea>

          <cfform  enctype="multipart/form-data"  action="FileReceiver.cfm" >

                 

                              File To Upload:

                 

                              <cfinput type="file" name="Filename" size="50" >

                   <br/>       

                              <cfinput type="submit" name="UploadFile" value="UPLOAD THIS FILE">

                      <br/>

                        

                     

              </cfform>

      </cflayoutarea>

       

      <cflayoutarea>       

          <table border="1" >

                  <tr>

                  <th >

                      Directory Information

                  </th>

                  </tr>

                  <tr>

                      <td>

                      <cfoutput >

                          CurrectDirectory Path: #getdirectoryFromPath(expandPath("index.cfm"))#

                      </cfoutput>

                      </td>

                  </tr>

              </table>

       

       

      </cflayoutarea>

      </cflayout>

         

          </body>

       

      </html>

      <!-- -->

       

       

      3.FileReceiver.cfm

       

      <!---start-->

      <cfif isdefined('UploadFile')  >

       

      <cfoutput >

       

      <cffile nameconflict="makeunique"

      action="upload"

      filefield="Form.Filename"

      destination="#getdirectoryFromPath(expandPath("index.cfm"))#" > <!--- or destination="c:\Upload\"--->

       

              File upload was successful!

      </cfoutput>

      </cfif>

       

      <!-- -->

       

      when i click on "update link" index page shows the FileUpload.cfm page in one of its container but while uploading file

      i always get ERROR MESSAGE:

       

      Error retrieving markup for element cf_layoutarea736558924094373 : Invalid content type: application/x-www-form-urlencoded; charset=UTF-8. [Enable debugging by adding 'cfdebug' to your URL parameters to see more information]

       

      Kindly Help me doing it right...i am unable to figure out problem ...