File tree 2 files changed +2
-50
lines changed
2 files changed +2
-50
lines changed Original file line number Diff line number Diff line change @@ -36,7 +36,7 @@ def upload_file(image_path):
36
36
b_res = s3 .list_buckets ()
37
37
# for i in b_res['Buckets']:
38
38
# 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 :
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 " ,"download.jpg" )
Original file line number Diff line number Diff line change 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
You can’t perform that action at this time.
0 commit comments