【发布时间】:2018-11-26 11:45:38
【问题描述】:
我在我的树莓派上运行一个烧瓶服务器。我想使用我的应用程序将 mp3 文件从 android 手机发送到树莓派。我已成功将 mp3 文件读入 InputStream 对象。我想知道如何将此对象发送给 Pi
【问题讨论】:
-
100% 与任何其他文件相同。 mp3 没什么特别的
我在我的树莓派上运行一个烧瓶服务器。我想使用我的应用程序将 mp3 文件从 android 手机发送到树莓派。我已成功将 mp3 文件读入 InputStream 对象。我想知道如何将此对象发送给 Pi
【问题讨论】:
您将使用分段上传来上传 .mp3 文件
我建议您使用 ION 上传到服务器。
示例
Ion.with(getContext())
.load("POST" , "//your server address)
.setMultipartParameter("key", "value")
.setMultipartFile("name which is used in flask server to distinguish data", "audio/mp3", new File("//location of file"))
.asJsonObject()
.setCallback(...)
请参考:https://github.com/koush/ion 了解更多
【讨论】: