質問するログイン新規登録

質問編集履歴

2

記述ミス

2017/05/19 09:46

投稿

kuriya
kuriya

スコア35

title CHANGED
File without changes
body CHANGED
@@ -132,10 +132,11 @@
132
132
  #VersionId='string',
133
133
  #RequestPayer='requester'
134
134
  )
135
+ print(key)
135
- print(Key + "is deleted")
136
+ print("is deleted")
136
137
  except Exception as e:
138
+ print(key)
137
139
  print("not deleted")
138
- print(Key)
139
140
  ```
140
141
 
141
142
  よろしくお願いいたします。

1

書式の改善

2017/05/19 09:46

投稿

kuriya
kuriya

スコア35

title CHANGED
File without changes
body CHANGED
@@ -120,5 +120,22 @@
120
120
 
121
121
  return "Success"
122
122
  ```
123
+ 以下を追加することで画像は削除出来るようになったのですが、そうするとエンコードのファイルが生成される前にエンコード前のファイルが削除されてしまうので実行タイミングをエンコード後とする必要があります。
124
+ 何か良い方法はありましたら教えていただきたく存じます。
125
+ ```
126
+ #エンコード前のファイルを削除
127
+ try:
128
+ response = s3.delete_object(
129
+ Bucket=OUT_BUCKET_NAME,
130
+ Key=key,
131
+ #MFA='string',
132
+ #VersionId='string',
133
+ #RequestPayer='requester'
134
+ )
135
+ print(Key + "is deleted")
136
+ except Exception as e:
137
+ print("not deleted")
138
+ print(Key)
139
+ ```
123
140
 
124
141
  よろしくお願いいたします。