Click here to Skip to main content
15,938,682 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
Friends i have a problem in my project.i hope to get your help here.
my problem is,
i need to upload image in my android mobile to my web server using web services.im using ksoap method.in my project , i can register user ,login user
but now i need to upload android mobile images to web server.

i ll put user registration code ------------------------------------------------------

RegisterActivity.java

public void onClick(View arg0) {

		EditText pasword = (EditText) findViewById(R.id.txtpasswordReg);
		EditText confpasword = (EditText) findViewById(R.id.txtConfPassw);
		
		if (pasword.getText().toString().equals(confpasword.getText().toString())) {
			SoapServiceProvider service = new SoapServiceProvider();
			service.SetUrl_nameSpace("http://tempuri.org/",
					"http://192.168.43.47/leaf/PLRSUVWebService.asmx");
			EditText txtName = (EditText) findViewById(R.id.txtName);
			EditText txtEmail = (EditText) findViewById(R.id.txtEmailAddress1);
			Object result = service.getService(new String[][] {
					{ "Name", txtName.getText().toString() },
					{ "Email", txtEmail.getText().toString() },
					{ "Password", pasword.getText().toString() } },
					"userRegistartion");
			if (result.toString().equals("True"))
			{
				Toast.makeText(RegisterActivity.this, "Registartion Sucessfully", Toast.LENGTH_SHORT).show();
			}
			else 
				Toast.makeText(RegisterActivity.this, "Error Occure", Toast.LENGTH_SHORT).show();
		}
		else
			Toast.makeText(RegisterActivity.this, "Password not matching", Toast.LENGTH_SHORT).show();
	}

-------------------------------------------------------------------------------------------
PLRSUVWebService.cs

C#
[WebMethod]
    public string userRegistartion(string Name, string Email, string Password)
    {
        string sql = "INSERT INTO Persons (Name, Email, PassWord, IMEI,state) ";
        sql += " VALUES  ('" + Name + "', '" + Email + "', '" + Password + "', '','2')";

        dbAccess db = new dbAccess();

        return db.UPDATE(sql).ToString();
    }

}

------------------------------------------------------------------------------------

i did that way.so now i need to upload the image also same way that i register users.
this is the folder path i need to upload that image
C:\Users\Thilan\Desktop\test\ourWebSite\mobile\

can u guys give me a good solution for this?
if u have some unclear places please ask me.
Posted
Updated 21-Sep-13 4:54am
v2

1 solution

 
Share this answer
 
Comments
Thilantdm 21-Sep-13 13:49pm    
thankz friend for those links.im going to try those now.but most of them are php and java.and none of them use ksoap.
ridoy 21-Sep-13 13:56pm    
Ok,then also check these:http://stackoverflow.com/questions/5415390/sending-pictures-to-a-web-server, http://stackoverflow.com/questions/18682109/send-image-to-my-website-using-android-device
Thilantdm 21-Sep-13 15:40pm    
those links are good.thanks my friend.now im trying using ur links.thank a lot.i ll let u know about working or not.thnkz again
ridoy 21-Sep-13 16:32pm    
Will be glad if those could help you.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900