【发布时间】:2013-01-11 16:03:00
【问题描述】:
我正在为 web 移动使用 html 5 <input type="file" accept="image/*;capture=camera"/> 文件元素
拍照它工作正常,但我如何处理 file.value 以将其发送到 Web 服务或数据库?
这是移动设备的演示Demo link
这是我的代码,但不起作用 我无法获取文件上传值
<html>
<script>
function getPhoto()
{
alert('2');
var fu1 = document.getElementById("myfile").value;
alert("You selected " + fu1);
}
</script>
<body>
<form>
<input type="file" name="myfile" accept="image/*;capture=camera"/>
<input type="submit"/>
<input type="button" value="get Photo path" onclick="getPhoto()">
</form>
</body>
</html>
【问题讨论】:
-
嗨 robertc 我添加了我的代码
-
我猜应该是
accept="image/*" capture="camera"? dev.opera.com/articles/view/media-capture-in-mobile-browsers
标签: html api jquery-mobile mobile