[Zope] Attach File

john blair mailtome200420032002 at yahoo.com
Thu Feb 24 04:25:41 EST 2005


How can I know all the attributes related to filePath
??


--- "SER.RI-TIC-Alexis Roda" <alexis.roda at urv.net>
wrote:

> john blair wrote:
> > Hi
> > I want to upload a file.The user provides the file
> > title and file path.
> > Say this is the form 
> > <input type="text" name="fileTitle">
> > <input type="file" name="filePath">
> > Now I want the name of the file to be the id of
> the
> > file in zope.Say the user attaches the file
> > /var/test.doc.Then id of the file should be
> test.doc
> > 
> > add_method =
> > context.manage_addProduct['OFSP'].manage_addFile
> > add_method(??,filePath,fileTitle)
> 
> Probably the filename is not a good choice for the
> id. IDs must comform
> the the regexp [a-zA-Z0-9-_~,.$\(\)# ]+, file names
> shouldn't
> 
> anyway, IIRC what you get when you upload a file is
> a
> ZPublisher.HTTPRequest.FileUpload instance wich has
> a filename attribute
>   (filePath.filename in your example,) wich stores
> the full path of the
> file on the client side
> 
> 
> 
> 
> HTH
> -- 
>                                     ////
>                                    (@ @)
>
----------------------------oOO----(_)----OOo--------------------------
> <>               Ojo por ojo y el mundo acabara
> ciego
> /\ Alexis Roda - Universitat Rovira i Virgili -
> Reus, Tarragona (Spain)
>
-----------------------------------------------------------------------
> 
> 
> _______________________________________________
> Zope maillist  -  Zope at zope.org
> http://mail.zope.org/mailman/listinfo/zope
> **   No cross posts or HTML encoding!  **
> (Related lists - 
>  http://mail.zope.org/mailman/listinfo/zope-announce
>  http://mail.zope.org/mailman/listinfo/zope-dev )
> 


__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 


More information about the Zope mailing list