IE8 Image Upload preview and "invalid image file" prompt solution
Today, I changed the Windows 7 system. The default browser is IE8. After the operating environment of all websites is configured, I debugged the picture uploaded and previewed yesterday. The prompt "invalid image file" is displayed "!
Google has found many of these problems. The core reason is that IE8 still uses the default security mechanism to restrict remote access to local file paths. Only one file name can be obtained.
The solution is to click IE8 tool item> Internet Options> Security> Custom Level> check the upload path, but this method is used for half a day and is for the beta1 version.
This will upload the path I have never found.
Even if I find it, if the user and I are the same browser, do you want me to modify the user's browser settings?ProgramStart.
Add a letter to the IE7 and ff3 Files written yesterday for upload preview.
Function getvalue (ID ){
Id. Select (); // select this object
Return document. selection. createRange (). Text; // return the text content of the selected item
}
Use the above function to submit the returned value to the previousCode;
The complete ie code is
Function getvalue (ID) {ID. Select (); Return document. selection. createRange (). Text ;}
VaR fielvalue = getvalue (imgfile );
$ ID ('den den '). Filters. Item ("DXImageTransform. Microsoft. alphaimageloader"). sizingmethod = 'image ';
Try {$ ID ('den den '). Filters. Item ("DXImageTransform. Microsoft. alphaimageloader"). src = fielvalue ;}
Catch (e) {W = 0; h = 0; return ;}
VaR wh = {'W': $ ID ('den den '). offsetwidth, 'H': $ ID ('den den'). offsetheight };
VaR bili = wh ['H']/wh ['W'];
If (wh ['W']> 100) {wh ['W'] = 100; wh ['H'] = 100 * bili };
$ ID ('ddden '). style. width = wh ['W'];
$ ID ('did'). style. Height = wh ['H'];
$ ID ('den den '). Filters. Item ("DXImageTransform. Microsoft. alphaimageloader"). sizingmethod = 'Scale ';
$ ID ("ieview"). innerhtml = '
(Sizingmethod = \ 'scale \ ', src = \ ''+ fielvalue +' \ '); width:' + wh ['W'] + '; height: '+ wh ['H'] +' "src = \ '/> ';
Replace the above Code with the Image Upload preview else section of FF and IE yesterday.
I tested IE 7 in Windows 7 and ietester0.3. ieteser IE6 fails to be tested once it is turned on, because the IE preview is achieved through the IE private filter.
So IE7 and IE8 should not be a problem if IE6 is enabled.
This article from the csdn blog, reproduced please indicate the source: http://blog.csdn.net/ajaxchen_615/archive/2009/04/09/4057884.aspx