在通过http上传之前压缩文件 [英] Compress file before upload via http

查看:182
本文介绍了在通过http上传之前压缩文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否可以压缩从客户端浏览器(文件上传)发送到服务器的数据?

Is it possible to compress data being sent from the client's browser (a file upload) to the server?

Flash,silverlight等技术可以! p>

Flash, silverlight and other technology is ok!

推荐答案

浏览器从不压缩上传的数据,因为他们无法知道服务器是否支持它。

Browsers never compress uploaded data because they have no way of knowing whether the server supports it.

下载的内容可以被压缩,因为Accept-Encoding请求头允许浏览器向服务器指示它支持压缩内容。不幸的是,没有等效的协议工作在其他方式,并允许服务器指示浏览器它支持压缩。

Downloaded content can be compressed because the Accept-Encoding request header allows the browser to indicate to the server that it supports compressed content. Unfortunately, there's no equivalent protocol that works the other way and allows the server to indicate to the browser that it supports compression.

如果你有控制服务器和客户端例如使用silverlight,flash),那么你可以使用压缩的请求主体。

If you have control over the server and client (e.g. using silverlight, flash) then you could make use of compressed request bodies.

这篇关于在通过http上传之前压缩文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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