Skip to content

Commit c90c50f

Browse files
author
Niharika Satapathy
committedApr 26, 2023
details removed
1 parent e61d744 commit c90c50f

File tree

2 files changed

+2
-50
lines changed

2 files changed

+2
-50
lines changed
 

Diff for: ‎generatepdf/pdf/s3file.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ def upload_file(image_path):
3636
b_res = s3.list_buckets()
3737
# for i in b_res['Buckets']:
3838
# print(i)
39-
with open(r"C:\Users\anves\Pictures\as.png",'rb') as img:
39+
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 ","download.jpg")

Diff for: ‎main.py

-48
Original file line numberDiff line numberDiff line change
@@ -1,48 +0,0 @@
1-
# import boto3
2-
# from botocore.exceptions import NoCredentialsError
3-
4-
# # ACCESS_KEY = 'AKIAVUQMV7NGTJBURAUJ'
5-
# # SECRET_KEY = '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'
6-
# # locations = "Asia Pacific ap-south-1"
7-
# ACCESS_KEY = 'AKIAVUQMV7NGS6WA2KEM'
8-
# SECRET_KEY = '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'
9-
10-
# import logging
11-
# import boto3
12-
# from botocore.exceptions import ClientError
13-
# import os
14-
15-
16-
# import logging
17-
# import boto3
18-
# from botocore.exceptions import ClientError
19-
# import os
20-
21-
22-
23-
# import boto3
24-
# import os
25-
26-
27-
# def upload_files(path):
28-
# session = boto3.Session(
29-
# aws_access_key_id=ACCESS_KEY,
30-
# aws_secret_access_key=SECRET_KEY,
31-
# region_name='ap-southeast-1'
32-
# )
33-
# s3 = session.resource('s3')
34-
# bucket = s3.Bucket('')
35-
36-
# for subdir, dirs, files in os.walk(path):
37-
# for file in files:
38-
# full_path = os.path.join(subdir, file)
39-
# with open(full_path, 'rb') as data:
40-
# bucket.put_object(Key=full_path[len(path) + 1:], Body=data)
41-
42-
43-
# if __name__ == "__main__":
44-
# d = upload_files(r'D:\projects\New folder (2)\PDF-Generator-Python\generatepdf\Madhutest.pdf')
45-
# print(d)
46-
47-
48-
# arn:aws:s3:::ivin-pro-data-conversion

0 commit comments

Comments
 (0)
Please sign in to comment.