Copy code code as follows:
imgpath = getRealPath (fileid);
document.GetelementByid ("Divsbtp"). STYLE.Filter = "Progid: Dximages scale ', src =/"" + imgpath + "/") "; // Use the filter effect
Function getRealPath (FileID) {
var file_upl = document.GetelementByid (FileID);
file_upl.select ();
Return document.selection.createrant (). Text;
}
Note: IE8 local picture upload preview cannot be directly used with $ ("#IMG"). ATTR ("SRC", ImaPath), because the browser is limited to visit local files, so use filters and div, if filters and IMG are used There are broken icons.