[Zope] Using ZPublisher.Client

Tony Lownds tony@www.printra.net
Mon, 16 Aug 1999 19:28:05 -0700 (PDT)


My problems are with sending files, multipart/form-data stuff.

When using Netscape,

sending a file to a Zope2 server works.
sending two files under the same name to a regular CGI works.

When using ZPublisher.CLient,

sending a file to a regular CGI works fine.
sending a file to a Zope2 (b4,ZServer) server hangs the client.
sending two files under the same name to a regular CGI doesnt work - the
data in the file does not get there. (details of that are in a previous
post)

I had not realized that sending regular parameters to a Zope2 client
worked, though - I did all my initial testing of "zmailclient" using a
regular CGI, and now I'm working on DTML docs to do stuff with uploaded
email info.

Looking in the code for Client.py, two very different code paths are taken
depending on whether its going to be a multipart-mime request or not. If
it is, then the code uses the socket module directly (instead of httplib)
and hangs on "reply=line.readline()" (line 287 or so). It takes two
ctrl-C's to break when its hung.

Hope that helps.

-Tony Lownds


On Mon, 16 Aug 1999, Michel Pelletier wrote:

> This works for me:
> 
> A DTML method in the root folder named 'DD' contains:
> 
> <!--#var standard_html_header-->
> 
> <dtml-in stuff>
>   <dtml-var sequence-item>
> </dtml-in>
> 
> <!--#var standard_html_footer-->
> 
> (Note that that you can mix DTML sytax for no good reason).
> 
> If I call it like:
> >>> Client.call('http://aldous:10080/DD', stuff=['one', 'two'])
> 
> It works dandy:
> 
> Client.call('http://aldous:10080/DD', stuff=['one', 'two'])
> (<mimetools.Message instance at 80d39e0>,
> '<HTML><HEAD><TITLE>Zope</TITLE></HEAD><BODY BGCOLOR="#FFFFFF">\012\012 
> one\012  two\012\012<p><a href="http://www.zope.org/Credits"><img
> src="http://aldous/p_/ZopeButton" width="115" height="50" border="0"
> alt="Powered by Zope"></a></p>\012</BODY></HTML>')
> >>> 
> 
> 
> Note that it iterated over the 'stuff' list and rendered two items,
> 'one' and 'two'.
> 
> Is the thing you're calling expecting 'att' to be a sequence?
> 
> -Michel
> 
> > -Tony Lownds
> > 
> > _______________________________________________
> > Zope maillist  -  Zope@zope.org
> > http://www.zope.org/mailman/listinfo/zope
> > 
> > (To receive general Zope announcements, see:
> > http://www.zope.org/mailman/listinfo/zope-announce
> > 
> > For developer-specific issues, zope-dev@zope.org -
> > http://www.zope.org/mailman/listinfo/zope-dev )
>