资源简介
使用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卡尔曼算法
相关资源
- 学生管理系统的添加、修改、删除、
- 基于MVC模式的校园BBS系统的设计与实
- Library图书馆图书管理系统
- 登录页的验证码
- 简易的新闻发布系统简易的新闻发布
- 网络书城模板
- 基于springboot框架的宿舍管理系统设计
- 毕业设计-基于struts汽车租赁管理系统
- 物联网,WEBSOCKET丰富案例
- 标准struts2和mvc写的用户管理
- 宠物商店系统设计
- 学科竞赛系统
- 计算机毕业设计的外文翻译附外文原
- e拍在线拍卖系统完整源代码及数据库
- 传智书城项目页面.rar
- 毕业设计-奖学金管理系统
- 当当网----全部代码
- 个人博客毕业论文加代码
- 简易版图书信息管理系统
- ssh校园二手物品交易网
- 宾馆酒店管理
- 毕业设计——旅游管理系统源代码
- 论坛代码毕业设计
- 网上订餐系统源代码
- 目录扫描字典.rar
- 一套自己花钱买的Web统计报表控件(
- 外卖网的设计与实现
- 酒店点餐系统带客户端服务端数据库
- 学科竞赛管理系统
- 个人博客系统的设计与实现.rar
评论
共有 条评论