#
# assuming
#
# curl --data "@/path/to/filename" http://.../receive_post/myfilename.txt
def receive_post():
open(os.path.join('somefolder',request.args[-1]),'w').write(request.body.read())
On Tuesday, 4 August 2015 10:23:55 UTC-5, Alehandro Ramoz Rodrigez wrote:
>
> I'm very new to web2py and I try use it for a simple purpose: I need to
> create an application that allow to send POST requests (with python
> requests library) to remote server with file to process, and get counter
> POST request with report-file.
> Now I have a page that I used to link with local folder from which I send
> files. This was easy with just adding
> Controller:
> def out:
> return dict(files=Expose('/home/user/Desktop/Files_to_Send')
> View:
> {{extend 'layout.html'}}
> {{=files}}
> But now I got stuck... There are some posts and manuals about similar
> issues in web, but I can not find how to setup application to just receive
> files via POST requests...
> I don't need any buttons, upload fields, databases etc.. Just another
> webpage that allow me to receive POST requests from remote server and save
> received files directly to my hard drive (e.g. to '
> /home/user/Desktop/Files_to_Receive').
> I will appreciate any help and advices.
>
--
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
---
You received this message because you are subscribed to the Google Groups
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/d/optout.