在PhoneGap Build的iFrame中输入type =“file”

时间:2013-01-14 11:24:43

标签: html cordova iframe input-type-file

我有一个构建了PhoneGap的HTML应用程序,它有一个iFrame到Web系统

此系统的一页是使用

进行的非常简单的文件上传
< input type="file"> etc...

在webOS环境中,这非常有效,但在PhoneGap中可以清楚地构建

<input type="file"> doesnt work.

我正在寻找 - 有点绝望 - 寻求解决方案,我可以改变

<input type="file">

使某些东西能够发挥作用。简单性是关键,因为iframe指向一个非常复杂的现有系统,我不愿意做出任何重大改变。

提前感谢您的所有帮助

此致

亨利

1 个答案:

答案 0 :(得分:2)

至少对我来说,输入文件在Phonegap中不起作用。

您需要使用Phonegap API来获取图片并选择来源的来源,例如photolibrary,camera或savedphotoalbum。

查看有关camera.getPicture:http://docs.phonegap.com/en/2.1.0/cordova_camera_camera.md.html#camera.getPicture的更多信息以及有关cameraOptions方法的Camera.PictureSourceType参数:http://docs.phonegap.com/en/2.1.0/cordova_camera_camera.md.html#cameraOptions