<input type="file" size="22" id="upload" class="form-file" accept="png,gif,jpg,jpeg" name="bimg">我写的代码只能得到文件名,不能得到上传时候的本地路径。比如 C:\Documents and Settings\Administrator\My Documents\Downloads\Breadcrumb_error.jpg $('input[type=file]').change(function(){
$('#demo').html($(this).val()); //只能得到Breadcrumb_error.jpg 而我想得到全部路径 C:\.......
});
谢谢
$('#demo').html($(this).val()); //只能得到Breadcrumb_error.jpg 而我想得到全部路径 C:\.......
});
谢谢
解决方案 »
- js同步获取aspx页面Response.Redirect传递的参数
- 这种分页除了js还能怎么做?
- js+ajax富客户端开发者俱乐部欢迎各位牛人加入
- 求购关于浮点数小数位取舍的function!
- window.dialogArguments帮俺看看!!
- 以前在网上下载过很多图标,如新增,保存,剪切,粘贴等,现在找不到了,不知哪儿能下载?
- 怎么今天好快的???
- alert((100.2556866243413).toFixed(5));错误
- 用VBScript制作网站搜索 -- 如何变为 JavaScript?
- easyui tree怎么才能更新子节点的数据啊!
- 关于Extjs取值问题,求高手解决
- 下面的javascript代码中,var a={};是什么意思?是定义一个空数组吗?另外:……
var isIE = (document.all) ? true : false;
var isIE7 = isIE && (navigator.userAgent.indexOf('MSIE 7.0') != -1);
var isIE8 = isIE && (navigator.userAgent.indexOf('MSIE 8.0') != -1); var file=document.getElementById("fileupload1");
if(isIE7 || isIE8)
{
file.select();
var path=document.selection.createRange().text;
document.selection.empty();
}
var f = document.getElementById("upload");
alert(f.value);
jquery不能获得了
<script language="javascript">
function preview(fileObj, id){
fileObj.document.execCommand("SelectAll");
var filePath = document.selection.createRange().text;
alert(filePath);
}</script><img id="img" style="display:none">
<input type="file" id="file" name="file" onchange="preview(this, 'img')">