Linux command line tool for uploading files over HTTP as multipart/form-data? (2 Solutions!!)
Channel: Roel Van de Paar
Date: 19/08/2020

Linux command line tool for uploading files over HTTP as multipart/form-data?


The Question: I can see that wget has a --post-file option, but the manpage says
 Wget does not currently support multipart/form-data for transmitting
 POST data; only application/x-www-form-urlencoded. Only one of --
 post-data and --post-file should be specified.
Is there a similar way for uploading files in multipart/form-data?

Solutions: Please watch the whole video to see all solutions, in order of how many people found them helpful

== This solution helped 31 people ==
Use curl:
curl -F "file=@localfile;filename=nameinpost" url.com

With thanks & praise to God, and with thanks to the many people who have made this project possible! | Content (except music & images) licensed under cc by-sa 3.0 | Music: https://www.bensound.com/royalty-free-music | Images: https://stocksnap.io/license & others | With thanks to user tu-Reinstate Monica-dor duh (https://superuser.com/users/160891), user Tobu (https://superuser.com/users/21402), user peterh - Reinstate Monica (https://superuser.com/users/208950), user kdt (https://superuser.com/users/6440), and the Stack Exchange Network (http://superuser.com/questions/86043). Trademarks are property of their respective owners. Disclaimer: All information is provided "AS IS" without warranty of any kind. You are responsible for your own actions. Please contact me if anything is amiss at Roel D.OT VandePaar A.T gmail.com.