[Zope] Stupid File Upload Question

jpenny@universal-fasteners.com jpenny@universal-fasteners.com
Mon, 18 Dec 2000 10:28:07 -0500


On Fri, Dec 15, 2000 at 04:59:07PM -0800, Jonothan Farr wrote:
> What sort of problems were you seeing with LocalFS? Maybe I can fix them.
> 
> Thanks,
> --jfarr
> 
> ----- Original Message ----- 
> From: <jpenny@universal-fasteners.com>
> To: <zope@zope.org>
> Sent: Friday, December 15, 2000 4:22 PM
> Subject: [Zope] Stupid File Upload Question
> 
> 
> > This is for Jos:
> > 
> > I ran into the same problem today.  I had previously used this method,
> > and it works better than LocalFS for my purposes.  Anyway, be absolutly
> > sure that your form says:

Fiest, LocalFS turns out to have the same problem.  MSIE does not
interact well with method=get and file input methods.

> > 
> > <form method=post action=whatever method="multipart/form-data">
> > ...
> > </form>
> > 
> > Then you should be able to access REQUEST.form['attachment'].filename
> > and REQUEST.form['attachment'].read()  (Well, I hope).
> > 
> > If the method=post is omitted, Netscape (linux at least) will work.
> > MSIE will not.
> > 
> > Man I ain't got enough hair for these kinds of problems!
> > 
> > Jim Penny

I want/need to collect some metadata along with the file.  Say I want
a file, a title, some keywords.  (And I have some idiots with 80MB files).

I would like to enforce the following:

No two files from a given user can have the same title.
A given file may not be uploaded twice by the same user with
different titles.

With LocalFS, as it stands, it is hard to determine the file that 
was uploaded.  (It is not returned by manage_upload, I could create
an id, but that has its own problems (downloading creates unexpected
files on the client PC's)).  This can be modified, but...

More importantly, it is really hard to see how to handle both of
the conditios above cleanly.  With LocalFS, I found no easy way
at all to combine the error checking implied by the metadata and
the error checking desired for the file name.

> > 
> > _______________________________________________
> > 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 )
> > 
> > 
>