Advertisement
Guest User

Untitled

a guest
Jan 19th, 2016
114
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.83 KB | None | 0 0
  1. HTTPRequest myRequest = new HTTPRequest (new Uri("url"), HTTPMethods.Post);
  2. myRequest.Credentials = new BestHTTP.Authentication.Credentials (user,pass);
  3. string content = "";
  4. BestHTTP.Forms.HTTPMultiPartForm Form = new BestHTTP.Forms.HTTPMultiPartForm ();
  5.  
  6. //Directory
  7. string filename = DateTime.UtcNow.ToString("yyyy-MM-dd HH-mm-ss");
  8. Form.AddField ("dirName", filename);
  9. //Send General Info Csv
  10. Form.AddField("info","stuff here");
  11.  
  12. //Generate Actions CSV
  13. Form.AddField ("tracking", "more stuff");
  14.  
  15. Form.AddBinaryData ("video", File.ReadAllBytes (Application.persistentDataPath + "/" + VideoFile + ".mp4"), VideoFile + ".mp4", "video/mp4");
  16. myRequest.SetForm (Form);
  17. myRequest.ConnectTimeout = new TimeSpan(0,10,0);
  18. myRequest.Timeout = new TimeSpan(0,10,0);
  19. myRequest.Send ();
  20. yield return myRequest;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement