From 5eb6115eff038959505986fe9c9dca56da3bacfb Mon Sep 17 00:00:00 2001 From: Karthik Suresh Date: Mon, 14 Dec 2015 15:53:56 +0530 Subject: [PATCH] Added local path upload into README Added upload from local path example to README.md --- README.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/README.md b/README.md index 0108f3b..d619bc7 100644 --- a/README.md +++ b/README.md @@ -22,6 +22,10 @@ s = 'Lola is sweet' # Creating a file r = requests.put(url, data=s, auth=S3Auth(ACCESS_KEY, SECRET_KEY)) +# Uploading from local path +files = {'file': open('file.txt', 'rb')} +r = requests.put(url, files=files, auth=S3Auth(ACCESS_KEY, SECRET_KEY)) + # Downloading a file r = requests.get(url, auth=S3Auth(ACCESS_KEY, SECRET_KEY)) if r.text == 'Lola is sweet':