how to display image uploaded in a submitted form with ploneformgen?
<p>I'm using <strong>ploneformgen</strong>.
[edited] I'm using a <strong>custom script adapter</strong> from ploneformgen to create a page using the information from submitted forms. The problem is: the page generated when i submit, doesn't show the image. I would like to create a page/document with text AND one image. How can I do this?</p>

<p>I've tried this code:</p>

<pre><code>#Creating the folder in zope instance. I gave the name 'conteudo' to it.
targetdir = context.conteudo

#Here asking for the form,  so we can access its contents
form = request.form

#Creating an unique ID
from DateTime import DateTime
uid= str(DateTime().millis())

# Creating a new Page (Document)
targetdir.invokeFactory('Document',id=uid, title= 'Minha PÃ¡gina', image= form['foto-de-perfil_file'],text='&lt;b&gt;Nome Completo:&lt;/b&gt;&lt;br&gt;'+form
['nome-completo']+'&lt;br&gt;&lt;br&gt;'+'&lt;b&gt;FormaÃ§Ã£o:&lt;/b&gt;&lt;br&gt;'+form
['formacao']+'&lt;br&gt;&lt;br&gt;'+'&lt;b&gt;Ãreas de AtuaÃ§Ã£o:&lt;/b&gt;&lt;br&gt;'+form['areas-de-    atuacao']+'&lt;br&gt;&lt;br&gt;'+'&lt;b&gt;Links:&lt;/b&gt;&lt;br&gt;'+form['links'])

# Set the reference for our new Page
doc = targetdir.get('uid',targetdir)

# Reindexed the Page in the site
doc.reindexObject()
</code></pre>

<p>It only shows the text, but the picture isn't there.</p>

<p>I tried using "setImage", but it shows an attribute error. I tried making another invokefactory but instead of 'Document', I put 'Image' then it only shows the image.</p>

<p><strong>What should I modify on my code to display <em>both</em> the text and the picture?</strong></p>

<p>Thanks in advance.</p>

<p>On a standard Plone Document content type does not own any image field.</p>

<p>If you are on Plone 4 using old ATContentTypes you must install and configure <a href="https://pypi.python.org/pypi/collective.contentleadimage" rel="nofollow">collective.contentleadimage</a>.
On Plone 5 or if you are using Dexterity based contents you must add the new image field to your schema.</p>

python plone ploneformgen