-1

I have recorded a file and saved it in sdcard as mp3.Now I need to send that file to webservice.How can I acheive that?Pls give some ideas.

I need to convert the mp3 file to byte array and pass to webservice.How can I pass the file to java webservice.

user977808
  • 223
  • 1
  • 2
  • 10
  • What kind of web service? Something you control? Someone else's service? If the latter, there should be some documentation. – Thilo Dec 08 '11 at 05:41

2 Answers2

1

You have to do some googling on it, you can found many blogs, SO question and tutorials..

OK fine just go through these..

Android: Upload image or file using http POST multi-part

Sending pictures to a web server

Android httpclient file upload data corruption and timeout issues

Community
  • 1
  • 1
user370305
  • 108,599
  • 23
  • 164
  • 151
  • If you are use httpmime-4.1-beta1.jar for you upload file then I think you don't have to convert file into bytes it does in background but I think it depends on your webservice how it handles the request. And here you didn't give any details about web service. – user370305 Dec 08 '11 at 05:46
0

Convert the MP3 data into it's Base64 equivalent and then send it as a String. On the server,decode it accordingly.

st0le
  • 33,375
  • 8
  • 89
  • 89
  • @Thilo, My answer still stands. [Look here](http://stackoverflow.com/questions/19893/how-do-you-embed-binary-data-in-xml) for more info. – st0le Dec 08 '11 at 05:42