[Zope] Re: Upload just file headers?

Paul Winkler slinkp23@yahoo.com
Wed, 11 Oct 2000 01:51:39 -0400


Still haven't found an answer, after 4 hours searching the
egroups archive.

Just to clarify:
I need to read the headers of the files BEFORE I upload the
entire file, because the files may be very large and I need
to be able to give a warning if the file does not meet
certain criteria. Example: a jpeg file of 500x400 pixels,
approx. 200 kb when the application, to be used in an
application that needs much higher resolution in order to
look good. I want to avoid wasting 50 seconds or so
uploading this file just to find out that it's no good. 

If I could upload the first bit of the file (1k should be
plenty), I could open it with PIL and check the size
attribute. (I've verified this by doing head --bytes 500
foo.jpeg > test.jpeg and then opening test.jpeg in python -
it works even though the file has been truncated.)


I wrote:
> 
> I'd like to make a form that looks like the typical file
> upload form, but will upload ONLY the header of the chosen
> file.
> Anyone know how / if this can be done?


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