[Zope] Re: Upload just file headers?

Chris McDonough chrism@digicool.com
Wed, 11 Oct 2000 09:53:55 -0400


Paul,

I'm sorry if I'm dropping context here, but I'm not sure what you mean when
you say "headers of files".

Do you just want to check the size of files before you put them in the ZODB?


----- Original Message -----
From: "Paul Winkler" <slinkp23@yahoo.com>
To: "Zope mailing list" <zope@zope.org>
Sent: Wednesday, October 11, 2000 1:51 AM
Subject: [Zope] Re: Upload just file headers?


> 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
>
> _______________________________________________
> Zope maillist  -  Zope@zope.org
> http://lists.zope.org/mailman/listinfo/zope
> **   No cross posts or HTML encoding!  **
> (Related lists -
>  http://lists.zope.org/mailman/listinfo/zope-announce
>  http://lists.zope.org/mailman/listinfo/zope-dev )
>
>