Skip to content

Commit ef928d8

Browse files
access crendetial removed
1 parent b96ad4a commit ef928d8

File tree

1 file changed

+21
-21
lines changed

1 file changed

+21
-21
lines changed

generatepdf/pdf/s3file.py

+21-21
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,26 @@
1-
import requests
2-
token = "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ0b2tlbl90eXBlIjoiYWNjZXNzIiwiZXhwIjoxNjg4OTc4NzY0LCJqdGkiOiJhMWU5ZWE2ODU4Mzc0OWE3YjNiZDFlNjcxN2Q4MDhkNyIsInVzZXJfaWQiOjV9.O9Yyi4lTU8r40pqf8fyjzDLJNbR8S0yUrbRqF0Ww2Mc"
1+
# import requests
2+
# token = "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ0b2tlbl90eXBlIjoiYWNjZXNzIiwiZXhwIjoxNjg4OTc4NzY0LCJqdGkiOiJhMWU5ZWE2ODU4Mzc0OWE3YjNiZDFlNjcxN2Q4MDhkNyIsInVzZXJfaWQiOjV9.O9Yyi4lTU8r40pqf8fyjzDLJNbR8S0yUrbRqF0Ww2Mc"
33

4-
def upload_file(image_path):
5-
url = 'https://staging-api.vivifyhealthcare.com/ImageUpload/DocUpload/'
6-
# url = "http://127.0.0.1:8008/pdf/gen/"
7-
headers = Imageheaders = {
8-
'Accept-Language': 'en-US',
9-
'Authorization': f'Bearer {token}'
10-
}
11-
import PyPDF2
4+
# def upload_file(image_path):
5+
# url = 'https://staging-api.vivifyhealthcare.com/ImageUpload/DocUpload/'
6+
# # url = "http://127.0.0.1:8008/pdf/gen/"
7+
# headers = Imageheaders = {
8+
# 'Accept-Language': 'en-US',
9+
# 'Authorization': f'Bearer {token}'
10+
# }
11+
# import PyPDF2
1212

13-
pdfFileObj = open(image_path, 'rb')
14-
# pdfReader = PyPDF2.PdfFileReader(pdfFileObj)
15-
files = {'UploadDoc': pdfFileObj}
16-
response = requests.post(url,files=files,headers=headers)
17-
print(response.status_code)
18-
imageurl = response.json()['Result']
13+
# pdfFileObj = open(image_path, 'rb')
14+
# # pdfReader = PyPDF2.PdfFileReader(pdfFileObj)
15+
# files = {'UploadDoc': pdfFileObj}
16+
# response = requests.post(url,files=files,headers=headers)
17+
# print(response.status_code)
18+
# imageurl = response.json()['Result']
1919

20-
doc = (imageurl.items())
21-
for i in doc:
22-
url = (i[1])
23-
return url
20+
# doc = (imageurl.items())
21+
# for i in doc:
22+
# url = (i[1])
23+
# return url
2424

2525

2626
# image_path = r"D:\projects\New folder (2)\PDF-Generator-Python\generatepdf\Lifeeazy-HealthSummaryl.pdf"
@@ -39,4 +39,4 @@ def upload_file(image_path):
3939
with open(r"D:\Madhu\project\Python\PDF-Generator-Python\generatepdf\generatepdf\result.html",'rb') as img:
4040
s3.upload_fileobj(img,b_name,"testfile.jpg")
4141
#
42-
s3.download_file(b_name,"testfile.jpg ","download.jpg")
42+
s3.download_file(b_name,"testfile.jpg")

0 commit comments

Comments
 (0)