Enas S3efan
Enas S3efan

Reputation: 81

upload image on twitpic using as3

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');

Upvotes: 1

Views: 355

Answers (0)

Related Questions