1 Reply Latest reply on Jun 3, 2010 1:39 PM by GeorgeWS

    jpg upload

    GeorgeWS Level 1

      I have this that should send a file (.jpg) to a ColdFusion server.

      This is the Flex part:

       

       

      private function upload():void

      {

       

      var uploader:Uploader = new Uploader();

      var dir:File = File.applicationStorageDirectory.resolvePath("images");

      var files:Array = dir.getDirectoryListing();

       

      for (var i:uint = 0; i < files.length; i++)

      {

      file = files[i];

      if (!file.isDirectory)

      {

      uploader.addFile(file);

      }

      }

      uploader.addEventListener(Event.COMPLETE, uploadCompleteHandler);

      uploader.addEventListener(ProgressEvent.PROGRESS, progressHandler);

      uploader.start(UPLOAD_URL +

      "/upload.cfm");

      }

       

      The images are at the applicationStorageDirectory location when upload button pressed they look like they are loading up to the server but nothing happens. I made an error page and its telling me:

       

      Detail  - [empty string]

      FileField - Filedata

      Message - The form field Filedata did not contain a file

       

      How do I get a file to the upload.addFile(file); ?

       

      This is the CF part:

       

      <cftry>

         <cffile action="upload"
               filefield="Filedata"
               destination="c:\inetpub\wwwroot\Files\Files\Chains\Displays\"
               nameconflict="overwrite"
               accept="application/octet-stream"/>
        
      <cfcatch type="any">
         <cfdocument format="PDF" overwrite="yes" orientation="landscape" filename="errordebug.pdf">
          <cfdump var="#cfcatch#"/>
         </cfdocument>
        </cfcatch>
      </cftry>

       

       

      Any thoughts? I have been at this for weeks