You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

15 lines
290 B

3 years ago
  1. #!/usr/bin/python3
  2. import requests
  3. import sys
  4. ### print (sys.argv)
  5. ### print(len(sys.argv))
  6. if len(sys.argv) < 3:
  7. print("Invalid parameters\n")
  8. exit
  9. filename = sys.argv[2]
  10. url = sys.argv[1]
  11. files = {'file': open(filename, 'rb')}
  12. final_resp = requests.post(url, files=files)