Transfer a file to httpserver via POST command from curl

musbur at posteo.org musbur at posteo.org
Tue Dec 17 12:44:04 EST 2019


On Fri, 13 Dec 2019 03:54:53 +1100
Chris Angelico <rosuav at gmail.com> wrote:

> On Fri, Dec 13, 2019 at 3:44 AM Karthik Sharma
> <karthik.sharma at gmail.com> wrote:
> >
> > Is it really possible to transfer a large binary file from my
> > machine to the above httpserver via POST command and download it
> > again? If yes, is the above Flask app enough for that and what am I
> > doing wrong?  
> 
> I think your Flask code is okay (haven't checked in detail, but at
> first glance it looks fine), but for file uploads to be recognized in
> request.files, you'll need to change the way you run curl.

BTW, the canonical way to upload files via http is PUT, not POST. You
might want to look into that, but here it is off-topic.


More information about the Python-list mailing list