5 Replies Latest reply on Oct 11, 2010 7:12 AM by jfb00

    Uploading file with coldfusion cfc

    jfb00 Level 3

      Hi All,

      I have a cfc that will upload a file into my database using this concept.

      http://corfield.org/entry/File_Upload_and_CFCs

      To select the file I'm using FileReference

      private function browseAndUpload():void
                  {
                      fileReference = new FileReference();
                      fileReference.addEventListener(Event.SELECT,fileReference_Select);
                      fileReference.addEventListener(Event.CANCEL,fileReference_Cancel);
                      fileReference.browse();
                  }
                 
                  private function fileReference_Select(event:Event):void
                  {
                      fileReference.addEventListener(ProgressEvent.PROGRESS,fileReference_Progress);
                      fileReference.addEventListener(Event.COMPLETE,fileReference_Complete);
                      fileReference.addEventListener(IOErrorEvent.IO_ERROR,onLoadError);
                     
                      //fileReference.upload(request);
                      fileName = fileReference.name;
                      SM_RO.importFile();
                  }

      As you see I don't use the upload, I'm passing the name of the file to myImport method.

      I'm getting error that it's missing enctype="multipart/form-data"

      How can I set this?

      Thanks

       

      Johnny