bharath
bharath

Reputation: 14453

How to send the mp3/mp4 file from Raw folder to server on Android?

I have the mp3/mp4 files on Raw folder. I need to send these files to server side. I'm using MultipartRequestEntity (FilePart) for sending the files to server side. How to get the Raw folder files as FILE?

Upvotes: 1

Views: 507

Answers (1)

Aleks G
Aleks G

Reputation: 57316

You should be able to read from that file using something like

InputStream instream = this.getResources.openRawResource(R.raw.myfile);

and then just read your standard input stream (I suggest wrapping it with buffering, e.g. BurreredInputReader)

Upvotes: 3

Related Questions