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

質問編集履歴

2

不要なコマンドラインがあったので削除

2020/08/31 07:42

投稿

hanju8810tt
hanju8810tt

スコア16

title CHANGED
File without changes
body CHANGED
@@ -110,7 +110,6 @@
110
110
  "NG! "+ err
111
111
  } else {
112
112
 
113
- document.getElementById("status").innerHTML =
114
113
  function s3cpfile(funcbn,funcpre2){
115
114
  funcbn=BUCKET_NAME;
116
115
  funcpre2=prefix2;

1

ボタンを押下すると、aws s3 cpコマンドが実行されるようにしたいのです。

2020/08/31 07:42

投稿

hanju8810tt
hanju8810tt

スコア16

title CHANGED
File without changes
body CHANGED
@@ -12,8 +12,22 @@
12
12
  下のコードで、「 //↑ここでファイルをダウンロードしたい」の箇所にS3バケットからファイルをダウンロードする
13
13
  コードを記述したいです。どうかご教示願います。
14
14
 
15
+ ■試したこと
16
+ コマンドプロントからaws cliを使って任意のファイルをダウンロードするコマンドを作成しました。
17
+ aws s3 cp s3://<バケット名>/<ファイル名> <ダウンロード先>
15
18
 
19
+ 上記コマンドを実行する関数を作成しました。
20
+ function s3cpfile(funcbn,funcpre2){
21
+ funcbn=BUCKET_NAME;
22
+ funcpre2=prefix2; //←File Name(TextBox)の値です。
23
+ return "aws s3 cp s3://" + funcbn + "/" + funcpre2 +" " + "." ;
24
+ }
25
+
26
+ これを実行したいのですが、(修正版)test.htmlでは実現できません。コマンドラインはあっています。
27
+
28
+
29
+
16
- test.html
30
+ (修正版)test.html
17
31
  ```
18
32
  <!DOCTYPE html>
19
33
  <html>
@@ -97,8 +111,12 @@
97
111
  } else {
98
112
 
99
113
  document.getElementById("status").innerHTML =
114
+ function s3cpfile(funcbn,funcpre2){
100
- "Success!"
115
+ funcbn=BUCKET_NAME;
101
- //↑ここでファイルをダウンロードしたい
116
+ funcpre2=prefix2;
117
+ return "aws s3 cp s3://" + funcbn + "/" + funcpre2 +" " + "." ;
118
+             }
119
+             s3cpfile();
102
120
 
103
121
  }})
104
122
  }