PhoneGap的:选择设备和上传音频文件 [英] phoneGap: select audio file from device and upload

查看:168
本文介绍了PhoneGap的:选择设备和上传音频文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是新来的PhoneGap。我创建一个虚拟应用上传从的iOS / Android设备的音频文件本地服务器上。所以我想知道是否有打开音频库,并选择所需的音频文件上传方式。类似的图片库。

I am new to phoneGap. I am creating a dummy app to upload an audio file from iOS/android device on local server. So I was wondering if there is a way to open the audio gallery and select the required audio file to upload. Similar to an image gallery.

是否有可能打开音频列表,然后选择所需的音频文件?如果没有,什么是另类?

Is it possible to open audio list and select necessary audio file? If not, what is the alternative?

推荐答案

好吧,我已经实现<一个href=\"http://stackoverflow.com/questions/13220251/phonegap-cordova-select-multiple-photos/21351913#21351913\">$c$c使用文件的插件,就能把所有的文件夹递归遍历查找所有图片(创造了这个,因为我需要它不是直接由科尔多瓦提供多选择的方法)​​。您可以修改图像(搜索)的延伸即PNG,JPEG等具有音频扩展。
有了这个code你会得到的音频文件的路径,你可以使用文件传输来上传服务器

Well I have implemented code using file plugin which will iterate through all the folders recursively to find all the image (created this as I needed multi selection approach which is not directly provided by cordova) . You can modify the extension of image (search) i.e png,jpeg etc with audio extension. With this code you will get the path of audio files and you can make use of filetransfer to upload it on server

希望它可以帮助你。

这篇关于PhoneGap的:选择设备和上传音频文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆