上传文件
来源:互联网 发布:单片机主程序和子程序 编辑:程序博客网 时间:2024/05/29 14:54
String filePath = "c:/";
String fileName = request.getParameter("title");
InputStream inputStream =request.getInputStream();
FileOutputStream outputStream = new FileOutputStream(new File(filePath+fileName+".png"));
//int formlength = request.getContentLength();
int formlength = Integer.parseInt(request.getParameter("file"));
byte[] formcontent = new byte[formlength];
int totalread = 0;
int nowread = 0;
while (totalread < formlength) {
nowread = inputStream.read(formcontent, totalread, formlength);
totalread += nowread;
}
outputStream.write(formcontent);
outputStream.flush();
outputStream.close();
inputStream.close();
- 文件上传---文件上传
- 上传文件
- 文件上传
- 上传文件
- 文件上传
- 文件上传
- 上传文件
- 上传文件
- 文件上传
- 文件上传
- 文件上传
- 文件上传
- 文件上传
- 文件上传
- 文件上传
- 上传文件
- 文件上传
- 文件上传
- 无需怀疑:移到开发者的前景和“钱景”一片光明
- 网络编程总结
- 将正则表达式处理的内容转换到Dictionary<key, value>中
- linux设备驱动开发详解 阅读笔记4(第二篇 驱动核心理论)
- c++ 可重载运算符和不可重载运算符
- 上传文件
- 最新版魔幻手势,免ROOT 重磅推出
- C语言fopen操作文件
- ruby ubuntu
- 颠覆谭浩强,人人都是C专家
- 电脑性能测试(纯属娱乐)
- 爱遇寒流
- Bochs调试指令
- java中栈的一个小应用..