Join the social network of Tech Nerds, increase skill rank, get work, manage projects...
 
  • Upload Screen Shot to server

    • 0
    • 1
    • 1
    • 1
    • 0
    • 0
    • 0
    • 0
    • 650
    Comment on it

    Most of the apps or games allowed to the user to upload his screen shorts on the server for latter user.

    Today I am going to show how to upload screen shot to server in Unity3D.

    1. private string url = "www.mysiteURL";
    2.  
    3. Texture2D screenShot = Application.CaptureScreenshot("Screenshot.png");
    4.  
    5.  
    6. WWW form = new WWWForm();
    7. form.AddField("UserName","Inder");
    8. form.AddField("Password","Singh");
    9. form.AddBinaryData("ScreenShot",screenShot.EncodeToPNG);
    10.  
    11. WWW www = new WWW(url,form);
    12.  
    13. yield www; // Wait until the uploading is done
    14. if(www.error)
    15. {
    16. print("Login not successfully...");
    17. }
    18. else
    19. {
    20. print("Login successfully...");
    21.  
    22. // Apply your code here now...
    23. }

    Enjoy Coding.. :)

 0 Comment(s)

Sign In
                           OR                           
                           OR                           
Register

Sign up using

                           OR                           
Forgot Password
Reset Password
Fill out the form below and reset your password: