Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function saveFile0 (fileName: String, description: String, file: String, thumbnail: Texture2D) {
- var seed = genSeed ();
- var JSON = '{"session_id":"' + SessionID + '","user_name":"' + UserName + '","description":"' + description + '","user_email":null,"seed":"' + seed + ',"publisher_id":' + PublisherId + ',"keys":[],"ratings":[],"filename":"' + fileName + '","group":' + saveGroup + ',"command_id":"saveFile"}';
- JSON = encrypt (seed, JSON);
- var bytes : byte[] = thumbnail.EncodeToPNG();
- var form = new WWWForm();
- form.AddField ("command_id", "securePacket");
- form.AddField ("secure", JSON);
- form.AddField ("tracker_id", APIID);
- form.AddField ("Filename", "thumbnail");
- form.AddBinaryData ("thumbnail", bytes, "thumbnail", "image/png");
- form.AddField ("Filename", "file");
- form.AddBinaryData ("file", encoding.GetBytes(file), "file", "text/plain");
- form.AddField ("Upload", "Submit Query");
- var download : WWW = new WWW ("http://www.ngads.com/gateway_v2.php",form);
- yield download;
- guiText.text += download.text + "\n";
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement