0

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?

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.

Thanks in advance for any help.

1 Answer 1

2

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

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

Sign up to request clarification or add additional context in comments.

1 Comment

Yeah, I was afraid of that. I'll probably have to write my own server to handle the HTTP protocol in a non-standard way, which is a lot of work. Oh, well. Thanks anyway.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.