该用户从未签到
|
<% //String servletPath=request.getServletPath();
2 R, R7 J$ s! a4 n9 I, b: c- V* H // int end =servletPath.lastIndexOf('/')+1;
6 w% E3 n) T& E //System.out.println(end);" H, V7 C& A. x. `4 P3 e( r$ ?
//String photoPath=servletPath.substring(0,end);
; M% {2 w$ \! `4 T4 @9 P String path=request.getRequestURI();3 p; Q1 f# i' ~; I9 ~0 O% E8 i
//System.out.println(path);. \$ V, \5 F: j3 w* w1 |
int end =path.lastIndexOf('/')+1;; Z. ^, S4 T( e# z' J
String photoPath=path.substring(0,end);# S- e+ c" J4 J+ u% m, u! G
System.out.println(photoPath);4 G3 t N4 H% n; |6 P4 k7 C3 N
%>
1 ~# T% A4 M9 }<script language="javascript">" y5 j6 @, ~9 Q( A
function showPic(obj) {' h) b1 M8 ]! ^) j& j
var o = document.getElementById("showimg");2 W- [) o& F7 o
var b = document.getElementById("photoPath");
% J. M& R9 C X: I var i=obj.value.lastIndexOf('s')+2;
~' } p0 X+ }& P! x var j=obj.value.length;
% d! P; Q# p1 q //var a = document.image.value;
+ s# u9 \% r6 x5 ?. d //var int j=a.length;
6 o- J8 y& N5 U //var i=a.lastIndexOf('s')+2;
- H' l* }$ c {% D2 G8 H: b var filename=obj.value.substring(i,j);
G, t3 f( U# K: F- J o.src=b.value+"images/"+filename;
, [0 ?# n- L, M1 {9 e' N. z, [ o.style.display="";
9 o: s7 H8 N( ~4 f o.border=1;7 U- [, g% o+ N: R. o/ _ A
}/ }# @' C& {' A# ~# N
</script>
+ H& F" O7 r8 f5 M; j5 b+ G<form>
6 S; V6 r* O# L9 `% I& D<input name="image" type="file" id="image" size="50" >
- o! z1 m1 y2 `1 ?7 Y3 O. w<div align="center"><img name="showimg" id="showimg" src="" style="display:none;" alt="预览图片" /></div>1 g8 L# u5 Q0 C
</form> |
|