chrome文件上传 /获取文件路径c:/fakepath的解决办法
来源:互联网 发布:家用健身器材 知乎 编辑:程序博客网 时间:2024/05/16 08:27
jsp页面
<td style="text-align: left;padding-left: 20px;"> <img name="image" id="myimage" src="" style="width: 80px;height: 100px"/> <a href="javascript:;" class="file">选择图片 <input type="file" onchange="changeImge(this)" name="selectFile" value="" id="selectFile"> </a> </td>
js代码
function changeImge(obj) { var f = obj.files[0]; var filePath = getPath(obj); var type = f.type;//image/jpeg var size = f.size; var tp = type.split("/")[0]; = if (tp != "image" || size > 10*1024*1024){ alert("请选择图片-10MB内!") return false; } var element = document.getElementById('myimage'); if (filePath != null && filePath != "") {
//获取文件路径
element.src = window.URL.createObjectURL(obj.files[0]); ; }
}
阅读全文
0 0
- chrome文件上传 /获取文件路径c:/fakepath的解决办法
- IE8上传文件时获取文件本地路径问题(C:\fakepath\……)的解决办法
- IE8上传文件时获取文件本地路径问题(C:\fakepath\……)的解决办法
- IE8上传文件时获取文件本地路径问题(C:\fakepath\……)的解决办法
- 上传文件时路径总是C:\fakepath\的问题
- 上传图片文件预览时C:\fakepath\文件路径问题
- Flex 调用javascript上传文件读取文件的本地路径的一直是 "C:/fakepath/" 的解决方案
- C:\fakepath\文件路径问题
- C:\fakepath\文件路径问题
- C:\fakepath\文件路径问题
- C:\\fakepath\\文件路径问题
- C:\fakepath\文件路径问题
- C:\fakepath\文件路径问题
- C:\fakepath\文件路径问题
- C:\fakepath\文件路径问题
- IE8上传文件时javascript取文件的本地路径的问题C:/fakepath/
- IE8上传文件时javascript取文件的本地路径的问题C:/fakepath/
- IE8+上传文件时javascript取文件的本地路径的问题C:/fakepath/
- Git安装及使用文章网址收录
- 自然语言处理
- python入门运算(shape 、tile 、sum)
- VS2017+PCL1.8.1+Cmake(3.6 or later)环境配置
- 第十一周项目二——操作用邻接表存储的图
- chrome文件上传 /获取文件路径c:/fakepath的解决办法
- 深度学习第一课 第四周 深层神经网络用python的实现
- leetcode 446. Arithmetic Slices II
- malloc、free、calloc、realloc的介绍
- maven-assembly-plugin 入门指南
- python2.7出现IOError: [Errno 5] Input/output error
- 最长公共子串问题 动态规划
- xgboost 用法讲解
- 2017-12-9