pb with attach file
Hello, Few months ago, I send my problem with attach file with Zope 2.6 and higher. How I have no solution, I send again my problem which is described after -------- Thanks to help me Frederique --------------- I have created a zclass with zfile as basic class. With this class, users could, via a web form, send an attached file if they want. With zope 2.5 (my previous version) if users don't attach a file, there is no problem with zope 2.10, if there is no file attached, I have an error message : 'file not specified". It seems that attach file is mandatory. Here, the complete message from the events log : Traceback (innermost last): Module ZPublisher.Publish, line 119, in publish Module ZPublisher.mapply, line 88, in mapply Module ZPublisher.Publish, line 42, in call_object Module OFS.DTMLMethod, line 144, in __call__ - <DTMLMethod at /assistance/do_add> - URL: http://assistance.abes.fr/do_add/manage_main - Physical Path: /assistance/do_add Module DocumentTemplate.DT_String, line 476, in __call__ Module DocumentTemplate.DT_With, line 76, in render Module DocumentTemplate.DT_Util, line 196, in eval - __traceback_info__: _ Module <string>, line 1, in <expression> Module OFS.DTMLMethod, line 137, in __call__ - <DTMLMethod at /assistance/Quest_susvp_add> - URL: http://assistance.abes.fr/Quest_susvp_add/manage_main - Physical Path: /assistance/Quest_susvp_add Module DocumentTemplate.DT_String, line 476, in __call__ Module DocumentTemplate.DT_With, line 61, in render Module DocumentTemplate.DT_Util, line 196, in eval - __traceback_info__: REQUEST Module <string>, line 1, in <expression> Module ZClasses.ZClass, line 454, in createInObjectManager Module ZClasses.ZClass, line 485, in fromRequest Module ZPublisher.mapply, line 89, in mapply Module OFS.Image, line 120, in __init__ Module OFS.Image, line 501, in _read_data ValueError: File not specified
blondelle@abes.fr wrote at 2008-12-8 11:43 +0100:
... Few months ago, I send my problem with attach file with Zope 2.6 and higher. How I have no solution, I send again my problem which is described after --------
Thanks to help me
Frederique
---------------
I have created a zclass with zfile as basic class. With this class, users could, via a web form, send an attached file if they want. With zope 2.5 (my previous version) if users don't attach a file, there is no problem with zope 2.10, if there is no file attached, I have an error message : 'file not specified". It seems that attach file is mandatory.
Here, the complete message from the events log :
Traceback (innermost last): ... Module ZClasses.ZClass, line 454, in createInObjectManager Module ZClasses.ZClass, line 485, in fromRequest Module ZPublisher.mapply, line 89, in mapply Module OFS.Image, line 120, in __init__ Module OFS.Image, line 501, in _read_data ValueError: File not specified
I cannot tell you what changed since Zope 2.5 (this is far too long ago). I can tell you why you get the exception above in modern Zope versions: A modern Zope version insists that if the "file" parameter to "OFS.Image.File.__init__" is a "FileUpload" object, then it must have a non empty filename. You may be able to use this in your "Quest_susvp_add" method as follows: You check whether the uploaded file is "False" (this means "empty filename") and in this case replace it in "REQUEST.form" with an empty string. Not sure that it will work, though. -- Dieter
participants (2)
-
blondelleļ¼ abes.fr -
Dieter Maurer