<%@ page language="java" import="java.util.*" pageEncoding="gbk"%>
<%@page import="java.net.URLEncoder"%>
<%@page import="com.censoft.zzportal.util.*"%>
<%@page import="java.io.FileOutputStream"%>
<%@page import="java.net.URLDecoder"%>
<%!
String imagepath1="";
//编辑页面中包含 camera.swf 的 HTML 代码
public String renderHtml(String id,String basePath,String input)
{
String outinput="";
try {
outinput = URLDecoder.decode(input);
}catch(Exception e)
{
System.out.println("解码错误!");
}
String[] tmp_input=outinput.split("@");//input传递的类型和uid
//System.out.println(input+","+tmp_input.length);
String uc_api =URLEncoder.encode(basePath+"upload/avatar.jsp");
String urlCameraFlash = "camera.swf?nt=1&inajax=1&appid=1&input="+input+"&uploadSize=1000&ucapi="+uc_api;
urlCameraFlash = "";
return urlCameraFlash;
}
public String getFileExt(String fileName) {
// 下面取到的扩展名错误,只有三位,而如html的文件则有四位
// extName = fileName.substring(fileName.length() - 3, fileName.length()); //扩展名
int dotindex = fileName.lastIndexOf(".");
String extName = fileName.substring(dotindex, fileName.length());
extName = extName.toLowerCase(); //置为小写
return extName;
}
private byte[] getFlashDataDecode(String src)
{
char []s=src.toCharArray();
int len=s.length;
byte[] r = new byte[len / 2];
for (int i = 0; i < len; i = i + 2)
{
int k1 = s[i] - 48;
k1 -= k1 > 9 ? 7 : 0;
int k2 = s[i + 1] - 48;
k2 -= k2 > 9 ? 7 : 0;
r[i / 2] = (byte)(k1 << 4 | k2);
}
return r;
}
public boolean saveFile(String path,byte[]b){
try{
FileOutputStream fs = new FileOutputStream(path);
fs.write(b, 0, b.length);
fs.close();
return false;
}catch(Exception e){
return true;
}
}
%>
<%
String uploadtype= request.getParameter("uploadtype");
//图片上传类型:头像,logo,图片分别对应参数:head,logo,pic没有传递,默认为PIC
if("".equals(uploadtype))
{
uploadtype="pic";
}
//最终裁剪好的图片存放位置
String uid=request.getParameter("uid");
imagepath1=uploadtype+"/"+uid+"_big.jpg";
String action= request.getParameter("a");
//String input=request.getParameter("input");
String path = request.getContextPath();
String infoFilePath="";
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
if(action==null){
%>
最后printscreen4web-jsp.war下载地址:http://602.s21-2.faidns.com/2872602/0/ABUIABAAGAAgs4y-mQUol8TuuwM?f=printscreen4web-jsp.war&v=1395639859