如何限制java servlet中的上传速度? [英] How to limit an upload speed in java servlet?

查看:160
本文介绍了如何限制java servlet中的上传速度?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在开发一个应用程序(基于Spring作为DI和MVC框架),它具有文件上传功能,目前使用Spring Multipart Upload实现(后者使用commons fileupload libs)。

I'm working on an app (based on Spring as DI and MVC framework) that has a file upload function which is currently implemented using Spring Multipart Upload (which in it's turn utilizes commons fileupload libs).

所以我正在寻找的是一种降低上传带宽消耗的方法。我该如何实现?

So what I'm looking for is a way to lower the upload bandwidth consumption. How can I accomplish that?

推荐答案

除非您在上面使用自定义文件上传器,否则可能无法限制上传带宽消耗客户。假设Spring Multipart Upload只是标准HTTP多部分表单上传的接口,那么它就是客户端Web浏览器,它实现了从客户端到服务器的实际文件流。除非客户端的浏览器具有一些限制带宽的功能,否则它可能会尝试尽快上传它。

Limiting the upload bandwidth consumption may not be possible unless you are using a custom file uploader on the client. Assuming that the Spring Multipart Upload is just an interface to the standard HTTP multipart form upload then it's the client web browser that implements the actual streaming of the file from the client to the server. Unless the client's browser has some functionality to limit the bandwidth it's probably trying it's best to get it uploaded as quickly as possible.

这篇关于如何限制java servlet中的上传速度?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆