Krishnakant
unread,May 26, 2016, 3:02:47 AM5/26/16Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to pylons-discuss
Hello,
I have been working on an accounting software which is being developed
as a RESTful api at the server side and a usual MVC based front end,
both made in Pyramid.
One unique feature of this software is that we have scanned images in
the voucher.
I wish to know two things, one is slightly off topic.
first, how do I send a request containing JSON object having all the
form fields + a png or jpeg image?
My requests from jinja template are ajax based and call a view at the
front end side.
So this view should be able to find this image in the request.params
method or what ever is suitable.
So this vew then talks to a separate REST API based service, again done
in Pyramid.
What happens here is that all the parameters from the request are packed
into a Python dictionary and then we do json.dumps on that packet.
The this jsonified object is sent to the rest api.
In the server we get this object using request.json_body and then work
on it.
Secondly, my server should be able to correctly get the image form the
json_body and then store it on the hard disk.
In all this I am not aware of how image is handled throughout all the
transfer process.
Can some one help?
happy hacking.
Krishnakant.