- 浏览: 1263011 次
- 性别:
- 来自: 北京
文章分类
- 全部博客 (896)
- spring4 (14)
- hibernate3 (26)
- spring2 (35)
- struts2 (55)
- struts1 (15)
- 设计模式 (15)
- java (172)
- mybatis3 (11)
- sql (17)
- mysql (13)
- jbpm (10)
- J2EE (45)
- tools (29)
- js (83)
- 数据结构 (13)
- Html (26)
- web (22)
- flex (33)
- Oracle (57)
- linux (49)
- 算法 (6)
- 其它 (12)
- easyui (1)
- bootstrap (13)
- xml (2)
- tomcat (1)
- redis (10)
- activemq (2)
- webservice (11)
- maven (2)
- springboot (1)
- ubuntu (1)
- python (14)
- rocketmq (1)
- springcloud (10)
- opencv (1)
最新评论
-
mike_eclipse:
Hashtable是线程不安全的吗?好像是线程安全的吧?
多线程之集合类 -
July01:
推荐用StratoIO打印控件,浏览器和系统的兼容性都很好,而 ...
lodop打印控件 -
xingcxb:
经过测试,假的,依旧会出现中文乱码!!!!store方法里面采 ...
java 读写Properties文件,不会出现中文乱码 -
tiger20111989:
...
Spring注解方式管理事务 -
zw7534313:
...
js 文字上下滚动 无间断循环显示
往网页分批推送数据:boundary=END,总头-->分头-->Body
@GetMapping("/test")
public void testjpg(HttpServletResponse response) throws IOException{
response.setContentType("multipart/x-mixed-replace;boundary=END");
// Set the content type based on the file type you need to download
String contentType = "Content-type: image/jpeg";
// List of files to be downloaded
List<File> files = new ArrayList();
files.add(new File("C:\\Users\\Administrator\\Desktop\\qq\\51.jpg"));
files.add(new File("C:\\Users\\Administrator\\Desktop\\qq\\52.jpg"));
files.add(new File("C:\\Users\\Administrator\\Desktop\\qq\\53.jpg"));
ServletOutputStream out = response.getOutputStream();
// Print the boundary string
out.println();
out.println("--END");
for(int i =0;i<500;i++) {
for (File file : files) {
// Get the file
FileInputStream fis = null;
try {
fis = new FileInputStream(file);
} catch (FileNotFoundException fnfe) {
// If the file does not exists, continue with the next file
System.out.println("Could not find file " + file.getAbsolutePath());
continue;
}
BufferedInputStream fif = new BufferedInputStream(fis);
// Print the content type
out.println(contentType);
out.println("Content-Disposition: attachment; filename=" + file.getName());
out.println();
System.out.println("Sending file " + file.getName());
// Write the contents of the file
int data = 0;
while ((data = fif.read()) != -1) {
out.write(data);
}
fif.close();
try {
Thread.sleep(500);
} catch (InterruptedException e) {
e.printStackTrace();
}
// Print the boundary string
out.println();
out.println("--END");
out.flush();
System.out.println("Finished sending file " + file.getName());
}
}
// Print the ending boundary string
out.println("--END--");
out.flush();
out.close();
}
发表评论
-
使用httpclient提交post请求
2020-08-22 08:35 387import org.apache.http.HttpEnt ... -
Groovy超强的Java动态计算能力
2020-06-25 09:03 588//Groovy超强的Java动态计算能力 groovy-2. ... -
bsh(BeanShell)动态执行java代码
2020-06-25 07:59 865import java.util.Date; /** * B ... -
延时任务处理订单超时方案
2020-05-23 16:05 896JDK的延迟队列 方案是利用JDK自带的DelayQueue ... -
HttpsURLConnection
2020-04-29 10:51 713import java.net.URL; import jav ... -
Log4j的ConversionPattern参数的格式含义
2020-04-22 14:23 418Log4j的ConversionPattern参数的格式含义 ... -
thread 的join
2020-04-16 18:02 313java里面也有这个方法,Java Thread中, join ... -
GZIPOutputStream压缩文件
2020-04-16 17:52 697import java.io.BufferedReader; ... -
软引用SoftReference的使用
2020-04-16 15:48 497软引用SoftReference的使用 SoftRefere ... -
Fastjson
2020-04-15 14:53 318import java.util.ArrayList; imp ... -
6位随机数
2020-04-14 09:47 702import org.apache.commons.lang. ... -
Java加密和数字签名
2020-04-14 09:38 344Java加密和数字签名 消息摘要 这是一种与消息认证码结合使 ... -
DES加密、解密
2020-04-02 16:42 357import java.security.SecureRand ... -
Java利用 AES/ECB/PKCS5Padding 算法加解密
2020-04-02 11:19 930对称加密、解密 import javax.crypto.Ci ... -
springboot中使用springmvc的拦截器-HandlerInterceptorAdapter
2018-12-13 16:04 1292springboot中使用springmvc的拦截器-Hand ... -
aspectj连接点
2018-12-13 15:55 511切点指示符 切点指示符 ... -
spring之AspectJ面向切面编程
2018-12-13 14:15 813spring之AspectJ面向切面编程 面向切面编程,实现 ... -
设计模式之策略模式
2018-05-30 21:17 479public class Person { priva ... -
使用反射将对象转Map
2018-05-27 17:33 647//使用反射将对象转Map<String, St ... -
设计模式之原型模式
2018-05-20 18:42 455/** * 原型设计模式:原型模式主要用于对象的复制 ...
相关推荐
1.SendNotification.jsp:发送通知页面,表单提交数据的类型为multipart/x-www-form-urlencoded 2.RecvNotification.jsp:接收通知页面 3.页面简单使用了Bootstrap样式 4.开发工具使用IDEA
c#没有现成的multipart/form-data库,自己封的一个demo供参考。
使用indy自带的idhttp控件,用form表单(multipart/form-data)形式上传文件(图片,视频等)
用C语言实现multipart/form-data文件上传,没有用到curl之类的库。之前做个小的日志上传程序写的。
使用c#实现的HttpClient拼接multipart/form-data形式参数post提交数据,包含图片内容,有需要的可以下载,希望能帮到有需要的人,
解决上传文件enctype= multipart/form-data 时无法传递其他参数的问题,以及项目全局编码问题。用的插件是commons io + commons fileupload
解决当FORM的ENCTYPE="multipart/form-data" 时request.getParameter()获取不到值的方法 ?
c#模拟post发送json和multipart/form-data格式
WebAPI通过multipart/form-data方式同时上传文件以及数据包含客户端上传例子
servlet上传 enctype="multipart/form-data" servlet上传 enctype="multipart/form-data
Android模拟 HTTP multipart/form-data 请求协议信息实现图片上传
c#下post 发送 multipart/form-data和JSON数据
我们知道在通过POST方式向服务器发送AJAX请求时最好要通过设置请求头来指定为application/x-www-form-urlencoded编码类型。知道通过表单上传文件时必须指定编码类型为"multipart/form-data"。那么为什么要这么设置呢
c#post multipart/form-data和JSON数据
解决当FORM的ENCTYPE="multipart/form-data" 时action方法或者控制层用request.getParameter()获取不到值的方法 ?
该程序是 multipart/form-data 远程dos利用程序,一台电脑直接打崩一台服务器!程序只为便于检测你服务器漏洞,切勿非法使用。 检测效果不明显的话,多运行几个实例将会增强攻击力度。
今天小编就为大家分享一篇python处理multipart/form-data的请求方法,具有很好的参考价值,希望对大家有所帮助。一起跟随小编过来看看吧
NULL 博文链接:https://wese345.iteye.com/blog/686108
解决java enctype multipart form-data文件上传传值问题 不使用jspsmartupload组件 可以轻轻松松 解决传值问题