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
* <p>Base exception class for all service exceptions from S3 service.</p>
303
303
*
304
304
* @public
305
-
* @example To upload an object and specify canned ACL.
305
+
* @example To create an object.
306
306
* ```javascript
307
-
* // The following example uploads and object. The request specifies optional canned ACL (access control list) to all READ access to authenticated users. If the bucket is versioning enabled, S3 returns version ID in response.
307
+
* // The following example creates an object. If the bucket is versioning enabled, S3 returns version ID in response.
308
308
* const input = {
309
-
* "ACL": "authenticated-read",
310
309
* "Body": "filetoupload",
311
310
* "Bucket": "examplebucket",
312
-
* "Key": "exampleobject"
311
+
* "Key": "objectkey"
313
312
* };
314
313
* const command = new PutObjectCommand(input);
315
314
* const response = await client.send(command);
316
315
* /* response ==
317
316
* {
318
317
* "ETag": "\"6805f2cfc46c0f04559748bb039d69ae\"",
319
-
* "VersionId": "Kirh.unyZwjQ69YxcQLA8z4F5j3kJJKr"
318
+
* "VersionId": "Bvq0EDKxOcXLJXNo_Lkz37eM3R4pfzyQ"
320
319
* }
321
320
* *\/
322
-
* // example id: to-upload-an-object-and-specify-canned-acl-1483397779571
321
+
* // example id: to-create-an-object-1483147613675
323
322
* ```
324
323
*
325
-
* @example To create an object.
324
+
* @example To upload an object
326
325
* ```javascript
327
-
* // The following example creates an object. If the bucketis versioning enabled, S3 returns version ID in response.
326
+
* // The following example uploads an object to a versioning-enabled bucket. The source file is specified using Windows file syntax. S3 returns VersionId of the newly created object.
328
327
* const input = {
329
-
* "Body": "filetoupload",
328
+
* "Body": "HappyFace.jpg",
330
329
* "Bucket": "examplebucket",
331
-
* "Key": "objectkey"
330
+
* "Key": "HappyFace.jpg"
332
331
* };
333
332
* const command = new PutObjectCommand(input);
334
333
* const response = await client.send(command);
335
334
* /* response ==
336
335
* {
337
336
* "ETag": "\"6805f2cfc46c0f04559748bb039d69ae\"",
338
-
* "VersionId": "Bvq0EDKxOcXLJXNo_Lkz37eM3R4pfzyQ"
337
+
* "VersionId": "tpf3zF08nBplQK1XLOefGskR7mGDwcDk"
339
338
* }
340
339
* *\/
341
-
* // example id: to-create-an-object-1483147613675
340
+
* // example id: to-upload-an-object-1481760101010
342
341
* ```
343
342
*
344
-
* @example To upload an object and specify optional tags
343
+
* @example To upload an object and specify server-side encryption and object tags
345
344
* ```javascript
346
-
* // The following example uploads an object. The request specifies optional object tags. The bucket is versioned, therefore S3 returns version ID of the newly created object.
345
+
* // The following example uploads an object. The request specifies the optional server-side encryption option. The request also specifies optional object tags. If the bucket is versioning enabled, S3 returns version ID in response.
347
346
* const input = {
348
-
* "Body": "c:\\HappyFace.jpg",
347
+
* "Body": "filetoupload",
349
348
* "Bucket": "examplebucket",
350
-
* "Key": "HappyFace.jpg",
349
+
* "Key": "exampleobject",
350
+
* "ServerSideEncryption": "AES256",
351
351
* "Tagging": "key1=value1&key2=value2"
352
352
* };
353
353
* const command = new PutObjectCommand(input);
354
354
* const response = await client.send(command);
355
355
* /* response ==
356
356
* {
357
357
* "ETag": "\"6805f2cfc46c0f04559748bb039d69ae\"",
358
-
* "VersionId": "psM2sYY4.o1501dSx8wMvnkOzSBB.V4a"
358
+
* "ServerSideEncryption": "AES256",
359
+
* "VersionId": "Ri.vC6qVlA4dEnjgRV4ZHsHoFIjqEMNt"
359
360
* }
360
361
* *\/
361
-
* // example id: to-upload-an-object-and-specify-optional-tags-1481762310955
362
+
* // example id: to-upload-an-object-and-specify-server-side-encryption-and-object-tags-1483398331831
362
363
* ```
363
364
*
364
-
* @example To upload an object and specify server-side encryption and object tags
365
+
* @example To upload object and specify user-defined metadata
365
366
* ```javascript
366
-
* // The following example uploads an object. The request specifies the optional server-side encryption option. The request also specifies optional object tags. If the bucket is versioning enabled, S3 returns version ID in response.
367
+
* // The following example creates an object. The request also specifies optional metadata. If the bucket is versioning enabled, S3 returns version ID in response.
367
368
* const input = {
368
369
* "Body": "filetoupload",
369
370
* "Bucket": "examplebucket",
370
371
* "Key": "exampleobject",
371
-
* "ServerSideEncryption": "AES256",
372
-
* "Tagging": "key1=value1&key2=value2"
372
+
* "Metadata": {
373
+
* "metadata1": "value1",
374
+
* "metadata2": "value2"
375
+
* }
373
376
* };
374
377
* const command = new PutObjectCommand(input);
375
378
* const response = await client.send(command);
376
379
* /* response ==
377
380
* {
378
381
* "ETag": "\"6805f2cfc46c0f04559748bb039d69ae\"",
379
-
* "ServerSideEncryption": "AES256",
380
-
* "VersionId": "Ri.vC6qVlA4dEnjgRV4ZHsHoFIjqEMNt"
382
+
* "VersionId": "pSKidl4pHBiNwukdbcPXAIs.sshFFOc0"
381
383
* }
382
384
* *\/
383
-
* // example id: to-upload-an-object-and-specify-server-side-encryption-and-object-tags-1483398331831
385
+
* // example id: to-upload-object-and-specify-user-defined-metadata-1483396974757
384
386
* ```
385
387
*
386
-
* @example To upload an object (specify optional headers)
388
+
* @example To upload an object and specify optional tags
387
389
* ```javascript
388
-
* // 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.
390
+
* // The following example uploads an object. The request specifies optional object tags. The bucket is versioned, therefore S3 returns version ID of the newly created object.
389
391
* const input = {
390
-
* "Body": "HappyFace.jpg",
392
+
* "Body": "c:\\HappyFace.jpg",
391
393
* "Bucket": "examplebucket",
392
394
* "Key": "HappyFace.jpg",
393
-
* "ServerSideEncryption": "AES256",
394
-
* "StorageClass": "STANDARD_IA"
395
+
* "Tagging": "key1=value1&key2=value2"
395
396
* };
396
397
* const command = new PutObjectCommand(input);
397
398
* const response = await client.send(command);
398
399
* /* response ==
399
400
* {
400
401
* "ETag": "\"6805f2cfc46c0f04559748bb039d69ae\"",
401
-
* "ServerSideEncryption": "AES256",
402
-
* "VersionId": "CG612hodqujkf8FaaNfp8U..FIhLROcp"
402
+
* "VersionId": "psM2sYY4.o1501dSx8wMvnkOzSBB.V4a"
403
403
* }
404
404
* *\/
405
-
* // example id: to-upload-an-object-(specify-optional-headers)
405
+
* // example id: to-upload-an-object-and-specify-optional-tags-1481762310955
406
406
* ```
407
407
*
408
-
* @example To upload an object
408
+
* @example To upload an object (specify optional headers)
409
409
* ```javascript
410
-
* // The following example uploads an object to a versioning-enabled bucket. The source file is specified using Windows file syntax. S3 returns VersionId of the newly created object.
410
+
* // 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.
411
411
* const input = {
412
412
* "Body": "HappyFace.jpg",
413
413
* "Bucket": "examplebucket",
414
-
* "Key": "HappyFace.jpg"
414
+
* "Key": "HappyFace.jpg",
415
+
* "ServerSideEncryption": "AES256",
416
+
* "StorageClass": "STANDARD_IA"
415
417
* };
416
418
* const command = new PutObjectCommand(input);
417
419
* const response = await client.send(command);
418
420
* /* response ==
419
421
* {
420
422
* "ETag": "\"6805f2cfc46c0f04559748bb039d69ae\"",
421
-
* "VersionId": "tpf3zF08nBplQK1XLOefGskR7mGDwcDk"
423
+
* "ServerSideEncryption": "AES256",
424
+
* "VersionId": "CG612hodqujkf8FaaNfp8U..FIhLROcp"
422
425
* }
423
426
* *\/
424
-
* // example id: to-upload-an-object-1481760101010
427
+
* // example id: to-upload-an-object-(specify-optional-headers)
425
428
* ```
426
429
*
427
-
* @example To upload object and specify user-defined metadata
430
+
* @example To upload an object and specify canned ACL.
428
431
* ```javascript
429
-
* // The following example creates an object. The request also specifies optional metadata. If the bucket is versioning enabled, S3 returns version ID in response.
432
+
* // The following example uploads and object. The request specifies optional canned ACL (access control list) to all READ access to authenticated users. If the bucket is versioning enabled, S3 returns version ID in response.
430
433
* const input = {
434
+
* "ACL": "authenticated-read",
431
435
* "Body": "filetoupload",
432
436
* "Bucket": "examplebucket",
433
-
* "Key": "exampleobject",
434
-
* "Metadata": {
435
-
* "metadata1": "value1",
436
-
* "metadata2": "value2"
437
-
* }
437
+
* "Key": "exampleobject"
438
438
* };
439
439
* const command = new PutObjectCommand(input);
440
440
* const response = await client.send(command);
441
441
* /* response ==
442
442
* {
443
443
* "ETag": "\"6805f2cfc46c0f04559748bb039d69ae\"",
444
-
* "VersionId": "pSKidl4pHBiNwukdbcPXAIs.sshFFOc0"
444
+
* "VersionId": "Kirh.unyZwjQ69YxcQLA8z4F5j3kJJKr"
445
445
* }
446
446
* *\/
447
-
* // example id: to-upload-object-and-specify-user-defined-metadata-1483396974757
447
+
* // example id: to-upload-an-object-and-specify-canned-acl-1483397779571
0 commit comments