Click here to Skip to main content
15,923,006 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I made csv file in adnroid and now i want to send to server using c#.net web service , what should i do any help please...
Posted

I solved this in way that...i send parameters to the web service and web service will made the csv file for the data...you will get the code for making csv in web service(any language)
 
Share this answer
 
Comments
haitrieu749 10-Nov-12 0:56am    
Good for you
Hey Vivek

You can Use these steps to upload file on server:-

C++
String url = "http://yourserver";
File file = new File(Environment.getExternalStorageDirectory(),
        "yourfile");
try {
    HttpClient httpclient = new DefaultHttpClient();

    HttpPost httppost = new HttpPost(url);

    InputStreamEntity reqEntity = new InputStreamEntity(
            new FileInputStream(file), -1);
    reqEntity.setContentType("binary/octet-stream");
    reqEntity.setChunked(true); // Send in multiple parts if needed
    httppost.setEntity(reqEntity);
    HttpResponse response = httpclient.execute(httppost);
    //Do something with response...

} catch (Exception e) {
    // show error
}
 
Share this answer
 
v2
Comments
AndroidVivek 12-Nov-12 5:29am    
hey thanks good example..it will help

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