You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* // example id: to-upload-an-object-1481760101010
264
264
* ```
265
265
*
266
-
* @example To upload object and specify user-defined metadata
266
+
* @example To upload an object (specify optional headers)
267
267
* ```javascript
268
-
* // The following example creates an object. The request also specifies optional metadata. If the bucket is versioning enabled, S3 returns version ID in response.
268
+
* // The following example uploads an object. The request specifies optional request headers to directs S3 to use specific storage class and use server-side encryption.
269
269
* const input = {
270
-
* "Body": "filetoupload",
270
+
* "Body": "HappyFace.jpg",
271
271
* "Bucket": "examplebucket",
272
-
* "Key": "exampleobject",
273
-
* "Metadata": {
274
-
* "metadata1": "value1",
275
-
* "metadata2": "value2"
276
-
* }
272
+
* "Key": "HappyFace.jpg",
273
+
* "ServerSideEncryption": "AES256",
274
+
* "StorageClass": "STANDARD_IA"
277
275
* };
278
276
* const command = new PutObjectCommand(input);
279
277
* const response = await client.send(command);
280
278
* /* response ==
281
279
* {
282
280
* "ETag": "\"6805f2cfc46c0f04559748bb039d69ae\"",
283
-
* "VersionId": "pSKidl4pHBiNwukdbcPXAIs.sshFFOc0"
281
+
* "ServerSideEncryption": "AES256",
282
+
* "VersionId": "CG612hodqujkf8FaaNfp8U..FIhLROcp"
284
283
* }
285
284
* *\/
286
-
* // example id: to-upload-object-and-specify-user-defined-metadata-1483396974757
285
+
* // example id: to-upload-an-object-(specify-optional-headers)
287
286
* ```
288
287
*
289
-
* @example To upload an object (specify optional headers)
288
+
* @example To upload object and specify user-defined metadata
290
289
* ```javascript
291
-
* // The following example uploads an object. The request specifies optional request headers to directs S3 to use specific storage class and use server-side encryption.
290
+
* // The following example creates an object. The request also specifies optional metadata. If the bucket is versioning enabled, S3 returns version ID in response.
292
291
* const input = {
293
-
* "Body": "HappyFace.jpg",
292
+
* "Body": "filetoupload",
294
293
* "Bucket": "examplebucket",
295
-
* "Key": "HappyFace.jpg",
296
-
* "ServerSideEncryption": "AES256",
297
-
* "StorageClass": "STANDARD_IA"
294
+
* "Key": "exampleobject",
295
+
* "Metadata": {
296
+
* "metadata1": "value1",
297
+
* "metadata2": "value2"
298
+
* }
298
299
* };
299
300
* const command = new PutObjectCommand(input);
300
301
* const response = await client.send(command);
301
302
* /* response ==
302
303
* {
303
304
* "ETag": "\"6805f2cfc46c0f04559748bb039d69ae\"",
304
-
* "ServerSideEncryption": "AES256",
305
-
* "VersionId": "CG612hodqujkf8FaaNfp8U..FIhLROcp"
305
+
* "VersionId": "pSKidl4pHBiNwukdbcPXAIs.sshFFOc0"
306
306
* }
307
307
* *\/
308
-
* // example id: to-upload-an-object-(specify-optional-headers)
308
+
* // example id: to-upload-object-and-specify-user-defined-metadata-1483396974757
309
309
* ```
310
310
*
311
311
* @example To upload an object and specify canned ACL.
0 commit comments