[Zope] upload a file to a folder using a variable for folder names

michael.taņag almightymike@yahoo.com
Thu, 5 Sep 2002 01:38:14 -0700 (PDT)


Hi!

I'm uploading a file to a particular folder in Zope using a form. For
example I need to upload celebrants.txt to 2002/august/birthday
so what I did (from a script by runyaga- thanks!)

context.2002.august.birthday.manage_addFile()

1. error when I use '2002' so I changed it to 'yr2002'
   (why can't I use '2002'?) code now becomes

   context.yr2002.august.birthday.manage_addFile()

2. The month and year are hard coded. What if I want it to be 
   supplied  by the user. So my idea is to use a variable.
   for example
    month = month_value
    year = year_value

   code becomes
   context.year.month.birthday.manage_addFile()

    for example
    if month_value is september and year is yr2002 code should read
    context.yr2002.september.birthday.manage_addFile()
   
   
   but this produces an error. I think python sees year and month
   as folder names.

   

   

   Can you help me. Thanks!
  




__________________________________________________
Do You Yahoo!?
Yahoo! Finance - Get real-time stock quotes
http://finance.yahoo.com