I am attempting to upload log files to pastebin using CURL.exe on a Windows 10 machine in a batch (.bat) file.
The following command works:
curl -X POST -d "api_dev_key=MY_DEV_KEY" -d "api_paste_code=this is a the text to send to pastebin" -d "api_option=paste" "https://pastebin.com/api/api_post.php" -d "api_expire_date=10M"
However, it only allows uploading a single line, where as I want to upload an entire file.
I tried:
curl -X POST -d "api_dev_key=MY_DEV_KEY" -T "logfile.txt" -d "api_option=paste" "https://pastebin.com/api/api_post.php"
But curl responds to this with "Bad API request, invalid api_dev_key".
I've found numerous options such as Easy way to paste command line output to paste bin services?, POSTing a file's contents with CURL, and Bash Script to upload files and data to Pastebin.com that allow you to either upload a file's contents to pastebin or pipe a command to curl as a post on unix / bash, but none of these work in batch do to a difference in handling pipes.
What is the proper way to post a logfile to pastebin from within a batch file?