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
    • 581
    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.

    private string url = "www.mysiteURL";
    
    Texture2D screenShot =     Application.CaptureScreenshot("Screenshot.png");
    
    
    WWW form = new WWWForm();
    form.AddField("UserName","Inder");
    form.AddField("Password","Singh");
    form.AddBinaryData("ScreenShot",screenShot.EncodeToPNG);
    
    WWW www = new WWW(url,form);
    
    yield www; // Wait until the uploading is done
    if(www.error) 
    {
        print("Login not successfully...");
    }
    else
    {
        print("Login successfully...");
    
        // Apply your code here now...
    }
    

    Enjoy Coding.. :)

 0 Comment(s)

Sign In
                           OR                           
                           OR                           
Register

Sign up using

                           OR                           
Forgot Password
Fill out the form below and instructions to reset your password will be emailed to you:
Reset Password
Fill out the form below and reset your password: