Home > Web Front-end > JS Tutorial > How to use JS to get the IE upload file path (IE7,8)_javascript skills

How to use JS to get the IE upload file path (IE7,8)_javascript skills

WBOY
Release: 2016-05-16 17:29:37
Original
1570 people have browsed it
Copy code The code is as follows:

function validateFileSize(id, maxsize) {
var btnsave = document .getElementById("Button2");                btnsave.disabled = false; fileupload.value.length< ; 5) { alert('Please select a file!'); return; }
           var agent = window.navigator.userAgent;
                                                            Msie 7.0 ')! = -1;
var isIe8 = agent.indexof (' msie 8.0 ')! = -1;
// IE7 and IE8 get file path
if (ISIE7 || ISIE8) { Fileupload.select ();
Filepath = Document.selection.createrange (). Text;
}> // IE6 Get the file path
Else
{filepath = file. value; }
//PageMethods.ValidateFile(filepath, maxsize, ieCallBack);
alert(filepath);
}
if (agent.indexOf( "Firefox") >= 1) {
           alert("FF");                      alert(getValue());              var size = fileupload.files[0].fileSize ;
                                                                                                              " onchange="disableSave(this);"/> ';
         alert("File exceeds size! " ); }

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template