上传完成之前访问http上传数据 [英] Accessing http upload data before upload completion

查看:80
本文介绍了上传完成之前访问http上传数据的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在上传完成之前,是否可以使用CGI脚本访问通过http上传的文件?例如,假设一个10兆字节的文件正在上传,并且恰好完成了10%,这意味着服务器具有1兆字节的数据。是否可以在不等待上载完成的情况下读取1兆字节的数据?

Is there any way to access a file being uploaded over http using a CGI script before the upload finishes? For example, say a 10 megabyte file is being uploaded, and is exactly 10% done, meaning the server has 1 megabyte of data. Is it possible to read that 1 megabyte of data without waiting for the upload to finish?

我对http上载的理解是服务器不会调用CGI脚本处理上传,直到接收到所有数据为止,但我希望可以采取一些措施。我正在使用python处理CGI请求(如果有什么区别)。

My understanding of http uploads is that the server won't call the CGI script handling the upload until all of the data is received, but I'm hoping there's some way around that. I'm using python to handle CGI requests if that makes any difference.

在此先感谢您的帮助。

推荐答案

CGI是Web服务器与外部应用程序之间通信的规范。

CGI is the specification of communication between the web server and the external application. It does not allow for this.

实际上,大多数Web服务器在完成上传之前不会做任何事情,但是没有理由您不能编写/更改一个(或可能找到一个,但我不知道会是哪个)以允许访问,但是您仍然不会通过CGI进行访问。

In fact, most web servers won't do anything with an upload until it finishes, but there's no reason you couldn't write/change one (or MAYBE find one, but I don't know which it would be) to allow access, but you're still not going to do it via a CGI.

http://www.ietf.org/rfc/rfc3875

这篇关于上传完成之前访问http上传数据的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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