1 Reply Latest reply on May 18, 2007 8:04 AM by peterent

    Can we upload a file using HTTPService

    Ashish Mishra
      Hi friends,

      I want to know that can i send a file from flex to servlet or struts using HttpService or not? I m using FileReference to upload a file.

      I just want to know that how can i send a file or multiple files as request parameter? Please tell me about this.
      Thanks in advance for your reply..


        • 1. Re: Can we upload a file using HTTPService
          peterent Level 2
          To allow the user to identify a file to upload to the server you must use FileReference. If you have data in memory (like XML or arrays) you can use HTTPService and send the data using the POST method on HTTPService.

          There is no way to automatically read files from the user's local machine. That would be a serious security threat. You can imagine what could happen if you could write a Flash app that very innocently ask for a file and then just went and uploaded all of the data files in a user's directory without their permission.

          So, no, you cannot automatically upload files using FileReference or HTTPService or anything else.