How to upload a BitmapData Object straight to my server?

前端 未结 6 486
北海茫月
北海茫月 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:42

    You can send your filename data and any other data you want along with the URLRequest:

    var params:URLVariables = new URLVariables();
    params.id = ride.id;
    params.filename = ride.map_image;
    params.path = 'maps/';
    var req:URLRequest = new URLRequest( ModelLocator.SERVER_URL + "/php/uploadpic.php");
    req.method = URLRequestMethod.GET;
    req.data = params;
    fileRef.upload(req);
    

    on the server side in php you access the extra variables as: $_REQUEST['path'] and $_REQUEST['filename'] etc

提交回复
热议问题