How to upload a BitmapData Object straight to my server?

前端 未结 6 478
北海茫月
北海茫月 2020-12-18 08:14

I wish to upload from my Flash Application (AS3) to imageshacks XML API. I wish to know how I can do this.

\"In Flash, we must POST the data using the UrlRequest and

6条回答
  •  独厮守ぢ
    2020-12-18 08:53

    i don't really get the problem of the question, anyway: If the question is how to send the name of the file and the extension (image type) from flash toghether with the byteArray of image data you should use a URLVariables object.

    This object could also send the query string as byte instead of text.

    var request:URLRequest = new URLRequest();
    request.url = "your_server_page_for_example.php";
    request.method = URLRequestMethod.POST;
    
    var variables:URLVariables = new URLVariables();
    variables.name = "imgName";
    variables.type = ".jpg";
    variables.image = myByteArray;
    
    request.data = variables;
    

提交回复
热议问题