1 Reply Latest reply on May 20, 2007 10:35 AM by ractoon

    What is the use of uploadDataFieldName in upload()

    Ashish Mishra Level 1
      Hi friends,
      I am not able to understand the purpose of uploadDataFieldName parameter of upload method.

      public function upload(request:URLRequest, uploadDataFieldName:String = "Filedata", testUpload:Boolean = false):void

      If is the file data, then How to get the data of a file? With browse I m able to get the file name only. How can I convert it into binary form. How to get the binary contents of the file?

      Plese help me regarding this, from many days i m facing the problem in fileupload programs. If somebody has done a file upload in Servlets or Struts using Jakarta Commons or in another way, Please guide me.

      Thanks in advance for your help
        • 1. Re: What is the use of uploadDataFieldName in upload()
          ractoon Level 1

          uploadDataFieldName:String (default = "Filedata") — The field name that precedes the file data in the upload POST operation. The uploadDataFieldName value must be non-null and a non-empty String. By default, the value of uploadDataFieldName is "Filedata", as shown in the following sample POST request

          quoted from:
          Adobe LiveDocs - Filereference

          So for example, if you have a PHP file handling the upload, you would reference it with $_FILES['Filedata'] for the default. But if you set it to some other value:

          someFileReference.upload(request, "Test");

          Then you would reference it with $_FILES['Test']