HTTP - post & get 第一篇
来源:互联网 发布:查看linux系统版本 编辑:程序博客网 时间:2024/05/21 10:59
package cn.itcast.utils;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.InputStream;
/**
* 上传文件
*/
public class FormFile {
/* 上传文件的数据 */
private byte[] data;
private InputStream inStream;
private File file;
/* 文件名称 */
private String filname;
/* 请求参数名称*/
private String formname;
/* 内容类型 */
private String contentType = "application/octet-stream";
public FormFile(String filname, byte[] data, String formname, String contentType) {
this.data = data;
this.filname = filname;
this.formname = formname;
if(contentType!=null) this.contentType = contentType;
}
public FormFile(String filname, File file, String formname, String contentType) {
this.filname = filname;
this.formname = formname;
this.file = file;
try {
this.inStream = new FileInputStream(file);
} catch (FileNotFoundException e) {
e.printStackTrace();
}
if(contentType!=null) this.contentType = contentType;
}
public File getFile() {
return file;
}
public InputStream getInStream() {
return inStream;
}
public byte[] getData() {
return data;
}
public String getFilname() {
return filname;
}
public void setFilname(String filname) {
this.filname = filname;
}
public String getFormname() {
return formname;
}
public void setFormname(String formname) {
this.formname = formname;
}
public String getContentType() {
return contentType;
}
public void setContentType(String contentType) {
this.contentType = contentType;
}
}
- HTTP - post & get 第一篇
- Get/Post in http
- http get post head
- http GET POST头
- Http Get Post 区别
- HTTP POST GET详解
- SOAP & HTTP-GET/POST
- Http方法 GET/POST
- HTTP POST GET
- android http post get
- http get post
- HTTP POST GET详解
- http get post
- http get post
- http post 和 get
- Http Get & Post总结
- Android HTTP GET/POST
- http get 和 post
- [转载]基于rtsp的手机视频点播实现和研究
- 程序中禁用一些标准函数的方法
- C#实现文本图片
- (c#)数据结构与算法分析 --数组、向量和表
- log4j的用法
- HTTP - post & get 第一篇
- 云计算拉开新一代产业变革大幕
- 得到最小缺号函数
- (c#)数据结构与算法分析 --递归
- (c#)数据结构与算法分析 --树
- HTTP - post & get 第二篇
- RUBY-FLEX实践—利用swfobject实现Rails与Flex传递参数
- 前置声明
- 实用资料——RS485总线理论及应用分析