[Zope] Re: Upload just file headers?

Paul Winkler slinkp23@yahoo.com
Wed, 11 Oct 2000 16:02:45 -0400


Thanks for the reply!

Seb Bacon wrote:
> 
> Hmm, well you certainly can't do it at the browser side.

Yes, I want to do it on the server.
 
> A well-formed HTTP header should contain a content-length attribute which
> you can examine.  However, deciding whether to accept the file or not would
> I imagine not be possible inside zope since the whole POST operation is
> handled by ZServer, so you probably have to write a cgi script to do it.
> For example, if you wanted to stick with python, you could use the cgi
> module.  You'd examine the header, and if you were happy, you could pass on
> the data in a new POST to zope.  If you were unhappy, you could return a
> value from the cgi.

Hmm... so I couldn't put this in an external method?
I guess CGI would be okay.

I should clarify: It's not actually the HTTP header I want
to examine, it's the first few bytes of the data itself. I
need to upload enough of the data to read some useful info,
then stop ASAP.
 
> This is all off the top of my head, and I'm sure there must be a nicer way
> of doing it than that.  It's not nice having it all outside zope.  but it
> should be a start, at least.
> 
> seb
> 

-- 
.................    paul winkler    ..................
slinkP arts:   music, sound, illustration, design, etc.
           web page:  http://www.slinkp.com
      A member of ARMS:   http://www.reacharms.com