0 Replies Latest reply on Mar 20, 2007 5:11 PM by mc7823478243

    Passing data when uploading File

    mc7823478243
      I am trying to pass data with my URLRequest when uploading a file.

      I have the following code to add the parameters to the request:

      var request:URLRequest = new URLRequest(saveRequest.url);
      request.method = URLRequestMethod.POST;
      request.data = saveRequest.request;
      try {
      fileRef.upload(request);
      } catch (error:Error) {
      Alert.show("Unable to upload file.");
      }

      where saveRequest is an HTTPService that I need to grab data from:
      <mx:HTTPService id="saveRequest" url="{theRoot}save-node-xml.html" resultFormat="e4x">
      <mx:request>
      <nodeUid>{editNodeUid}</nodeUid>
      </mx:request>
      </mx:HTTPService>

      When this code runs, I don't get any extra parameters (nodeUid) in my request. The file uploads, but the data does not seem to post.

      It seems to me like I am doing it just like the documentation tells me to. What am I doing wrong?