1
- import requests
2
- token = "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ0b2tlbl90eXBlIjoiYWNjZXNzIiwiZXhwIjoxNjg4OTc4NzY0LCJqdGkiOiJhMWU5ZWE2ODU4Mzc0OWE3YjNiZDFlNjcxN2Q4MDhkNyIsInVzZXJfaWQiOjV9.O9Yyi4lTU8r40pqf8fyjzDLJNbR8S0yUrbRqF0Ww2Mc"
1
+ # import requests
2
+ # token = "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ0b2tlbl90eXBlIjoiYWNjZXNzIiwiZXhwIjoxNjg4OTc4NzY0LCJqdGkiOiJhMWU5ZWE2ODU4Mzc0OWE3YjNiZDFlNjcxN2Q4MDhkNyIsInVzZXJfaWQiOjV9.O9Yyi4lTU8r40pqf8fyjzDLJNbR8S0yUrbRqF0Ww2Mc"
3
3
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
12
12
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']
19
19
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
24
24
25
25
26
26
# image_path = r"D:\projects\New folder (2)\PDF-Generator-Python\generatepdf\Lifeeazy-HealthSummaryl.pdf"
@@ -39,4 +39,4 @@ def upload_file(image_path):
39
39
with open (r"D:\Madhu\project\Python\PDF-Generator-Python\generatepdf\generatepdf\result.html" ,'rb' ) as img :
40
40
s3 .upload_fileobj (img ,b_name ,"testfile.jpg" )
41
41
#
42
- s3 .download_file (b_name ,"testfile.jpg " , "download.jpg " )
42
+ s3 .download_file (b_name ,"testfile.jpg" )
0 commit comments