Advertisement
Bcadren

Untitled

Feb 12th, 2014
70
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.08 KB | None | 0 0
  1. function saveFile0 (fileName: String, description: String, file: String, thumbnail: Texture2D) {
  2. var seed = genSeed ();
  3. 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"}';
  4. JSON = encrypt (seed, JSON);
  5. var bytes : byte[] = thumbnail.EncodeToPNG();
  6.  
  7. var form = new WWWForm();
  8.  
  9. form.AddField ("command_id", "securePacket");
  10. form.AddField ("secure", JSON);
  11. form.AddField ("tracker_id", APIID);
  12. form.AddField ("Filename", "thumbnail");
  13. form.AddBinaryData ("thumbnail", bytes, "thumbnail", "image/png");
  14. form.AddField ("Filename", "file");
  15. form.AddBinaryData ("file", encoding.GetBytes(file), "file", "text/plain");
  16. form.AddField ("Upload", "Submit Query");
  17.  
  18. var download : WWW = new WWW ("http://www.ngads.com/gateway_v2.php",form);
  19. yield download;
  20. guiText.text += download.text + "\n";
  21. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement