FormData javascript object, to send a file with a POST

26 views
Skip to first unread message

gu...@videotron.ca

unread,
Jul 18, 2019, 3:28:45 AM7/18/19
to pylons-discuss

Hi, I use a FormData javascript object, to send a file with a POST, how to access the FormData object in the pyramid request object.
Thank you

Steve Piercy

unread,
Jul 18, 2019, 3:53:12 AM7/18/19
to pylons-...@googlegroups.com
On 7/17/19 at 5:15 PM, gu...@videotron.ca pronounced:

>Hi, I use a FormData javascript object, to send a file with a
>POST, how to access the FormData object in the pyramid request object.

You can access POST variables as if it is a Python dictionary.

request.POST.items()

https://docs.python.org/3/library/stdtypes.html#mapping-types-dict
https://docs.pylonsproject.org/projects/pyramid/en/latest/api/request.html#pyramid.request.Request.POST

See also the IMultiDict interface, which extends the Python
dictionary interface.

https://docs.pylonsproject.org/projects/pyramid/en/latest/api/interfaces.html#pyramid.interfaces.IMultiDict

--steve

------------------------
Steve Piercy, Eugene, OR

gu...@videotron.ca

unread,
Jul 18, 2019, 9:30:07 AM7/18/19
to pylons-discuss
thanks for the help, i found request.POST['fichier'].file
Reply all
Reply to author
Forward
0 new messages