资源简介
使用smartupload可以简单地实现图片上传下载
代码片段和文件信息
package smartupload;
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;
public class SmartFile
{
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;
SmartFile()
{
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 IOExceptionSmartUploadException
{
saveAs(s0);
}
public void saveAs(String sint i) throws IOExceptionSmartUploadException
{
//Method invokes dubious new String() constructor; just use ““
//Creating a new java.lang.String object using the no-argument constructor wastes memory because the object so created will be functionally indistinguishable from the empty string constant ““.\u00A0 Java guarantees that identical string constants will be represented by the same String object.\u00A0 Therefore you should just use the empty string constant directly.
//String s1 = new String();
String s1 = ““;
s1 = m_parent.getPhysicalPath(si);
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_binArraym_startDatam_size);
fileoutputstream.close();
}
catch(IOException ioexception)
{
throw new SmartUploadException(“File can‘t be saved (1120).“);
}
}
public void fileToField(ResultSet resultsetString s) throws ServletExceptionIOExceptionSmartUploadExceptionSQLException
{
long l = 0L;
int i = 0x10000;
int j = 0;
int k = m_startData;
if(resultset
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
文件 7012 2016-12-15 15:19 smartupload\SmartFile.java
文件 1619 2016-12-15 15:19 smartupload\SmartFiles.java
文件 1985 2016-12-15 15:19 smartupload\SmartRequest.java
文件 27294 2016-12-15 15:19 smartupload\SmartUpload.java
文件 154 2016-12-27 15:51 smartupload\SmartUploadException.java
目录 0 2017-01-05 09:40 smartupload
----------- --------- ---------- ----- ----
38064 6
- 上一篇:IIS put scanner增强版
- 下一篇:EKF卡尔曼算法
相关资源
- 设计实现一个图书管理系统。图书信
- 大学生就业信息网源码
- 工作流设计器(多比图形控件).rar
- 小型户籍管理系统源码含数据库
- 百度云l_ipp_ia32_p_6.0.1.071.tar.gz
- 学校新闻系统
- 在线作业管理系统eclipse工程
- 网上人才招聘系统 源代码
- 毕业设计-基于springboot框架的宿舍管理
- JSP基于网络超市商品销售管理系统的
- 在线拍照flash
- 网上书店(有完整的代码)
- 科研申报系统
- 学生在线答疑
- 小型购物网站
- 酒店客房管理系统
- 宠物管理系统
- struts2框架设计的网上名片的管理系统
- 购物新天地网上商城
- 网上购物系统
- 简单电子书店后台管理系统含数据库
- 基于JSP 的网上论坛源码
- 医院住院管理系统
- 一个简单的jsp网页(初学者作品)
- jsp执行linux shell
- JSP电子商务购物商城 详细设计报告
- 机票预定管理系统 课程设计 数据库
- JSP动态网站开发课程设计报告
- 基于JSP的网上购物系统的设计与实现
- jsp成绩学生成绩录入系统
评论
共有 条评论