upload image on twitpic using as3

孤街醉人 提交于 2019-12-23 03:41:30

问题


how I can upload image on twitpic using as3 and flash professorial cs6 and i try the code below and nothing happened Thank's in advance

import flash.net.FileReference;
import flash.filesystem.File;
import flash.filesystem.FileMode;
import flash.filesystem.FileStream;
import flash.utils.ByteArray;



var urlVars:URLVariables = new URLVariables();
urlVars.username = "xxxx";
urlVars.password = "xxxxx";

var urlRequest:URLRequest = new URLRequest("http://twitpic.com/api/upload");
urlRequest.method = URLRequestMethod.POST;
urlRequest.data = urlVars;

var file:File = File.desktopDirectory.resolvePath("test.png");
file.upload(urlRequest, 'media');

来源:https://stackoverflow.com/questions/16645955/upload-image-on-twitpic-using-as3

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!