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>
250
250
*
251
251
* @public
252
-
* @example To upload an object and specify canned ACL.
252
+
* @example To create an object.
253
253
* ```javascript
254
-
* // 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.
254
+
* // The following example creates an object. If the bucket is versioning enabled, S3 returns version ID in response.
255
255
* const input = {
256
-
* "ACL": "authenticated-read",
257
256
* "Body": "filetoupload",
258
257
* "Bucket": "examplebucket",
259
-
* "Key": "exampleobject"
258
+
* "Key": "objectkey"
260
259
* };
261
260
* const command = new PutObjectCommand(input);
262
261
* const response = await client.send(command);
263
262
* /* response ==
264
263
* {
265
264
* "ETag": "\"6805f2cfc46c0f04559748bb039d69ae\"",
266
-
* "VersionId": "Kirh.unyZwjQ69YxcQLA8z4F5j3kJJKr"
265
+
* "VersionId": "Bvq0EDKxOcXLJXNo_Lkz37eM3R4pfzyQ"
267
266
* }
268
267
* *\/
269
-
* // example id: to-upload-an-object-and-specify-canned-acl-1483397779571
268
+
* // example id: to-create-an-object-1483147613675
270
269
* ```
271
270
*
272
-
* @example To create an object.
271
+
* @example To upload object and specify user-defined metadata
273
272
* ```javascript
274
-
* // The following example creates an object. If the bucket is versioning enabled, S3 returns version ID in response.
273
+
* // The following example creates an object. The request also specifies optional metadata. If the bucket is versioning enabled, S3 returns version ID in response.
275
274
* const input = {
276
275
* "Body": "filetoupload",
277
276
* "Bucket": "examplebucket",
278
-
* "Key": "objectkey"
277
+
* "Key": "exampleobject",
278
+
* "Metadata": {
279
+
* "metadata1": "value1",
280
+
* "metadata2": "value2"
281
+
* }
279
282
* };
280
283
* const command = new PutObjectCommand(input);
281
284
* const response = await client.send(command);
282
285
* /* response ==
283
286
* {
284
287
* "ETag": "\"6805f2cfc46c0f04559748bb039d69ae\"",
285
-
* "VersionId": "Bvq0EDKxOcXLJXNo_Lkz37eM3R4pfzyQ"
288
+
* "VersionId": "pSKidl4pHBiNwukdbcPXAIs.sshFFOc0"
286
289
* }
287
290
* *\/
288
-
* // example id: to-create-an-object-1483147613675
291
+
* // example id: to-upload-object-and-specify-user-defined-metadata-1483396974757
* // example id: to-upload-an-object-1481760101010
308
311
* ```
309
312
*
310
-
* @example To upload an object and specify optional tags
313
+
* @example To upload an object and specify canned ACL.
311
314
* ```javascript
312
-
* // 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.
315
+
* // 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.
313
316
* const input = {
314
-
* "Body": "c:\\HappyFace.jpg",
317
+
* "ACL": "authenticated-read",
318
+
* "Body": "filetoupload",
315
319
* "Bucket": "examplebucket",
316
-
* "Key": "HappyFace.jpg",
317
-
* "Tagging": "key1=value1&key2=value2"
320
+
* "Key": "exampleobject"
318
321
* };
319
322
* const command = new PutObjectCommand(input);
320
323
* const response = await client.send(command);
321
324
* /* response ==
322
325
* {
323
326
* "ETag": "\"6805f2cfc46c0f04559748bb039d69ae\"",
324
-
* "VersionId": "psM2sYY4.o1501dSx8wMvnkOzSBB.V4a"
327
+
* "VersionId": "Kirh.unyZwjQ69YxcQLA8z4F5j3kJJKr"
325
328
* }
326
329
* *\/
327
-
* // example id: to-upload-an-object-and-specify-optional-tags-1481762310955
330
+
* // example id: to-upload-an-object-and-specify-canned-acl-1483397779571
328
331
* ```
329
332
*
330
-
* @example To upload an object and specify server-side encryption and object tags
333
+
* @example To upload an object (specify optional headers)
331
334
* ```javascript
332
-
* // 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.
335
+
* // 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.
333
336
* const input = {
334
-
* "Body": "filetoupload",
337
+
* "Body": "HappyFace.jpg",
335
338
* "Bucket": "examplebucket",
336
-
* "Key": "exampleobject",
339
+
* "Key": "HappyFace.jpg",
337
340
* "ServerSideEncryption": "AES256",
338
-
* "Tagging": "key1=value1&key2=value2"
341
+
* "StorageClass": "STANDARD_IA"
339
342
* };
340
343
* const command = new PutObjectCommand(input);
341
344
* const response = await client.send(command);
342
345
* /* response ==
343
346
* {
344
347
* "ETag": "\"6805f2cfc46c0f04559748bb039d69ae\"",
345
348
* "ServerSideEncryption": "AES256",
346
-
* "VersionId": "Ri.vC6qVlA4dEnjgRV4ZHsHoFIjqEMNt"
349
+
* "VersionId": "CG612hodqujkf8FaaNfp8U..FIhLROcp"
347
350
* }
348
351
* *\/
349
-
* // example id: to-upload-an-object-and-specify-server-side-encryption-and-object-tags-1483398331831
352
+
* // example id: to-upload-an-object-(specify-optional-headers)
350
353
* ```
351
354
*
352
-
* @example To upload an object (specify optional headers)
355
+
* @example To upload an object and specify optional tags
353
356
* ```javascript
354
-
* // 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.
357
+
* // 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.
355
358
* const input = {
356
-
* "Body": "HappyFace.jpg",
359
+
* "Body": "c:\\HappyFace.jpg",
357
360
* "Bucket": "examplebucket",
358
361
* "Key": "HappyFace.jpg",
359
-
* "ServerSideEncryption": "AES256",
360
-
* "StorageClass": "STANDARD_IA"
362
+
* "Tagging": "key1=value1&key2=value2"
361
363
* };
362
364
* const command = new PutObjectCommand(input);
363
365
* const response = await client.send(command);
364
366
* /* response ==
365
367
* {
366
368
* "ETag": "\"6805f2cfc46c0f04559748bb039d69ae\"",
367
-
* "ServerSideEncryption": "AES256",
368
-
* "VersionId": "CG612hodqujkf8FaaNfp8U..FIhLROcp"
369
+
* "VersionId": "psM2sYY4.o1501dSx8wMvnkOzSBB.V4a"
369
370
* }
370
371
* *\/
371
-
* // example id: to-upload-an-object-(specify-optional-headers)
372
+
* // example id: to-upload-an-object-and-specify-optional-tags-1481762310955
372
373
* ```
373
374
*
374
-
* @example To upload object and specify user-defined metadata
375
+
* @example To upload an object and specify server-side encryption and object tags
375
376
* ```javascript
376
-
* // The following example creates an object. The request also specifies optional metadata. If the bucket is versioning enabled, S3 returns version ID in response.
377
+
* // 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.
377
378
* const input = {
378
379
* "Body": "filetoupload",
379
380
* "Bucket": "examplebucket",
380
381
* "Key": "exampleobject",
381
-
* "Metadata": {
382
-
* "metadata1": "value1",
383
-
* "metadata2": "value2"
384
-
* }
382
+
* "ServerSideEncryption": "AES256",
383
+
* "Tagging": "key1=value1&key2=value2"
385
384
* };
386
385
* const command = new PutObjectCommand(input);
387
386
* const response = await client.send(command);
388
387
* /* response ==
389
388
* {
390
389
* "ETag": "\"6805f2cfc46c0f04559748bb039d69ae\"",
391
-
* "VersionId": "pSKidl4pHBiNwukdbcPXAIs.sshFFOc0"
390
+
* "ServerSideEncryption": "AES256",
391
+
* "VersionId": "Ri.vC6qVlA4dEnjgRV4ZHsHoFIjqEMNt"
392
392
* }
393
393
* *\/
394
-
* // example id: to-upload-object-and-specify-user-defined-metadata-1483396974757
394
+
* // example id: to-upload-an-object-and-specify-server-side-encryption-and-object-tags-1483398331831
0 commit comments