[Zope] Q: Iterating through an arbitrary number of SUBMIT form REQUEST object files/attributes?

Samu Mielonen ex@uiah.fi
Mon, 25 Oct 1999 15:02:46 +0300


I've mananed to solve every single problem regarding to saving
images, replacing images, referencing image sizes, etc,. Thanks
to all the kind people on the list fo comments.

However, I'm still unsure how to handle the form data send via
post method by the browser.

Consider an arbitrary submit-form that contains different
variable types (text, numbers, boolean) and various file
types (images, video, etc.) via file-upload buttons.

Is there a way to handle a REQUEST object (from the above
arbitrary submit form) in such a manner that that it:

	1) Automatically reads all variable names, types and values
	   (e.g. <input type="text" name="name1:text"> with value
          "John Smith" is turned into a property name1 with value
          'John Smith' for the object to be handled)

	2) Automatically reads through all the included files
         (submitted through multipart/form-data), detects
         their type (if possible) and saves the inside the
         object in question as sub-objects.

	   (e.g. parrot.jpg is understood to be a file of
         type Image and saved as an image object with the
         id "parrot.jpg" or just "parrot")

Is this too much of an Herculean undertaking or is it something
done easily? I'm most interested in iterating through all of the
encoded files of a form submitted REQUEST object and saving each of
them with a proper id and type (image, etc) inside a folder (object).

Best regards,
	Samu Mielonen

PS I think I'm over the tipping point at which I'm starting to
appreciate the power of Zope, although learning is still very slow
for me and I mungle with syntax all the time :)

--
"Our reflections on the order of society, as well as nature, are still
dominated by the Newtonian image of massive power, exerted by sovereign
agency through the operation of central force..." -Stephen Toulmin,
"Cosmopolis"