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