資源簡介
一個實現可抓取編輯,頭像上傳功能。只要下載就可以運行,附有源碼

代碼片段和文件信息
package?com.jspsmart.upload;
import?java.io.ByteArrayInputStream;
import?java.io.FileOutputStream;
import?java.io.IOException;
import?java.math.BigInteger;
import?java.sql.ResultSet;
import?java.sql.SQLException;
import?javax.servlet.ServletException;
//?Referenced?classes?of?package?com.jspsmart.upload:
//?SmartUploadException?SmartUpload
public?class?File?{
private?SmartUpload?m_parent;
private?int?m_startData;
private?int?m_endData;
private?int?m_size;
private?String?m_fieldname;
private?String?m_filename;
private?String?m_fileExt;
private?String?m_filePathName;
private?String?m_contentType;
private?String?m_contentDisp;
private?String?m_typeMime;
private?String?m_subTypeMime;
private?String?m_contentString;
private?boolean?m_isMissing;
public?static?final?int?SAVEAS_AUTO?=?0;
public?static?final?int?SAVEAS_VIRTUAL?=?1;
public?static?final?int?SAVEAS_PHYSICAL?=?2;
File()?{
m_startData?=?0;
m_endData?=?0;
m_size?=?0;
m_fieldname?=?new?String();
m_filename?=?new?String();
m_fileExt?=?new?String();
m_filePathName?=?new?String();
m_contentType?=?new?String();
m_contentDisp?=?new?String();
m_typeMime?=?new?String();
m_subTypeMime?=?new?String();
m_contentString?=?new?String();
m_isMissing?=?true;
}
public?void?saveAs(String?s)?throws?IOException?SmartUploadException?{
saveAs(s?0);
}
public?void?saveAs(String?s?int?i)?throws?IOException
SmartUploadException?{
String?s1?=?new?String();
s1?=?m_parent.getPhysicalPath(s?i);
if?(s1?==?null)
throw?new?IllegalArgumentException(
“There?is?no?specified?destination?file?(1140).“);
try?{
java.io.File?file?=?new?java.io.File(s1);
FileOutputStream?fileoutputstream?=?new?FileOutputStream(file);
fileoutputstream.write(m_parent.m_binArray?m_startData?m_size);
fileoutputstream.close();
}?catch?(IOException?ioexception)?{
throw?new?SmartUploadException(“File?can‘t?be?saved?(1120).“);
}
}
public?void?fileToField(ResultSet?resultset?String?s)
throws?ServletException?IOException?SmartUploadException
SQLException?{
long?l?=?0L;
int?i?=?0x10000;
int?j?=?0;
int?k?=?m_startData;
if?(resultset?==?null)
throw?new?IllegalArgumentException(
“The?RecordSet?cannot?be?null?(1145).“);
if?(s?==?null)
throw?new?IllegalArgumentException(
“The?columnName?cannot?be?null?(1150).“);
if?(s.length()?==?0)
throw?new?IllegalArgumentException(
“The?columnName?cannot?be?empty?(1155).“);
l?=?BigInteger.valueOf(m_size).divide(BigInteger.valueOf(i))
.longValue();
j?=?BigInteger.valueOf(m_size).mod(BigInteger.valueOf(i)).intValue();
try?{
for?(int?i1?=?1;?(long)?i1? resultset.updateBinaryStream(s?new?ByteArrayInputStream(
m_parent.m_binArray?k?i)?i);
k?=?k?!=?0???k?:?1;
k?=?i1?*?i?+?m_startData;
}
if?(j?>?0)
resultset.updateBinaryStream(s?new?
?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----
?????文件????????340??2012-07-05?17:09??頭像上傳\ZoomImageDemo\.classpath
?????文件????????312??2012-07-05?17:09??頭像上傳\ZoomImageDemo\.myme
?????文件???????1231??2012-07-05?17:09??頭像上傳\ZoomImageDemo\.project
?????文件???????5440??2012-07-05?17:09??頭像上傳\ZoomImageDemo\src\com\jspsmart\upload\File.java
?????文件???????1188??2012-07-05?17:09??頭像上傳\ZoomImageDemo\src\com\jspsmart\upload\Files.java
?????文件???????1459??2012-07-05?17:09??頭像上傳\ZoomImageDemo\src\com\jspsmart\upload\Request.java
?????文件??????17027??2012-07-05?17:09??頭像上傳\ZoomImageDemo\src\com\jspsmart\upload\SmartUpload.java
?????文件????????141??2012-07-05?18:04??頭像上傳\ZoomImageDemo\src\com\jspsmart\upload\SmartUploadException.java
?????文件???????1729??2012-07-05?18:15??頭像上傳\ZoomImageDemo\src\com\servlet\UpLoadUserHeadImage.java
?????文件???????2249??2012-07-05?17:09??頭像上傳\ZoomImageDemo\src\com\servlet\ZoomImage.java
?????文件???????3460??2012-07-05?17:09??頭像上傳\ZoomImageDemo\src\com\teetaa\util\ImageHepler.java
?????文件???????1641??2012-07-05?17:09??頭像上傳\ZoomImageDemo\WebRoot\css\main.css
?????文件????????794??2012-07-05?17:09??頭像上傳\ZoomImageDemo\WebRoot\image\bg_120.gif
?????文件???????7281??2012-07-05?17:09??頭像上傳\ZoomImageDemo\WebRoot\image\blank.jpg
?????文件????????258??2012-07-05?17:09??頭像上傳\ZoomImageDemo\WebRoot\image\c.gif
?????文件????????587??2012-07-05?17:09??頭像上傳\ZoomImageDemo\WebRoot\image\grip.gif
?????文件????????258??2012-07-05?17:09??頭像上傳\ZoomImageDemo\WebRoot\image\h.gif
?????文件???????1617??2012-07-05?17:09??頭像上傳\ZoomImageDemo\WebRoot\image\man.GIF
?????文件??????14336??2012-07-05?17:09??頭像上傳\ZoomImageDemo\WebRoot\image\Thumbs.db
?????文件????????571??2012-07-05?17:09??頭像上傳\ZoomImageDemo\WebRoot\image\track.gif
?????文件????????255??2012-07-05?17:09??頭像上傳\ZoomImageDemo\WebRoot\image\_c.gif
?????文件????????255??2012-07-05?17:09??頭像上傳\ZoomImageDemo\WebRoot\image\_h.gif
?????文件???????1823??2012-07-05?17:40??頭像上傳\ZoomImageDemo\WebRoot\index.html
?????文件???????8939??2012-07-05?17:09??頭像上傳\ZoomImageDemo\WebRoot\js\CutPic.js
?????文件??????31046??2012-07-05?17:09??頭像上傳\ZoomImageDemo\WebRoot\js\jquery1.2.6.pack.js
?????文件?????136623??2012-07-05?17:09??頭像上傳\ZoomImageDemo\WebRoot\js\JSintellisense\jquery-1.2.6-intellisense.js
?????文件???????3931??2012-07-05?17:09??頭像上傳\ZoomImageDemo\WebRoot\js\ui.core.packed.js
?????文件???????9736??2012-07-05?17:09??頭像上傳\ZoomImageDemo\WebRoot\js\ui.draggable.packed.js
?????文件?????????39??2012-07-05?17:09??頭像上傳\ZoomImageDemo\WebRoot\me
?????文件???????5828??2012-07-05?17:42??頭像上傳\ZoomImageDemo\WebRoot\uploadimage.jsp
............此處省略41個文件信息
評論
共有 條評論