[python] Zope: ako uploadovat subory cez Controller Page Template?

Martin Stofcik martin.stofcik na pwc.sk
Pondělí Prosinec 19 10:45:40 CET 2005


no uz som prisiel na to, kde som spravil chybu. form v cpt musi
obsahovat method="post", cize takto:

<form enctype="multipart/form-data" method="post">
<input type="file" name="file"/>
<input class="button continue"
       type="submit"
       name="form.button.Save"
       value="Ulozit"/>
<input type="hidden" name="form.submitted" value="1" />
</form>


On Po, 2005-12-19 at 09:45 +0100, Martin Stofcik wrote:
> V zope v Controll Page Template form.cpt mam nieco ako:
> 
> <form enctype="multipart/form-data">
> <input type="file" name="file"/>
> <input class="button continue"
>        type="submit"
>        name="form.button.Save"
>        value="Ulozit"/>
> <input type="hidden" name="form.submitted" value="1" />
> </form>
> 
> spracovanim tohto formulara sa dostanem cez premennu file iba k nazvu
> suboru. Ako by som vedel dostat cely subor z tohto formulara? Napriklad
> tak ako to je v Page Template.
> 
> Napr. ak formular bude vyzerat takto:
> 
> <form enctype="multipart/form-data" action="skript">
> <input type="file" name="file"/>
> <input class="button continue"
>        type="submit"
>        name="form.button.Save"
>        value="Ulozit"/>
> <input type="hidden" name="form.submitted" value="1" />
> </form>
> 
> a ak dam v sktripe zobrazit context.REQUEST tak ten mi zobrazi nieco
> ako:
> 
> form
> 
> file <ZPublisher.HTTPRequest.FileUpload instance at 0x451e94cc>
> ...
> 
> tak toto by som chcel docielit aj pri Controll Page Template, viete ako
> na to?
> 
> --
> Martin Stofcik
> 
> 
> 
> ________ Information from NOD32 ________
> This message was checked by NOD32 Antivirus System for Linux Mail Server.
> http://www.nod32.com
> _______________________________________________
> Python mailing list
> Python na py.cz
> http://www.py.cz/mailman/listinfo/python
> 
> ________ Information from NOD32 ________
> This message was checked by NOD32 Antivirus System for Linux Mail Server.
> http://www.nod32.com




Další informace o konferenci Python