简体   繁体   English

如何将Raw文件夹中的mp3 / mp4文件发送到Android上的服务器?

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

I have the mp3/mp4 files on Raw folder. 我在Raw文件夹上有mp3 / mp4文件。 I need to send these files to server side. 我需要将这些文件发送到服务器端。 I'm using MultipartRequestEntity ( FilePart ) for sending the files to server side. 我正在使用MultipartRequestEntityFilePart )将文件发送到服务器端。 How to get the Raw folder files as FILE ? 如何将Raw文件夹文件获取为FILE

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, eg BurreredInputReader ) 然后只需读取标准输入流(我建议用缓冲包装它,例如BurreredInputReader

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM