1# @ohos.file.picker (Picker) 2 3> **NOTE** 4> 5> The initial APIs of this module are supported since API version 9. Newly added APIs will be marked with a superscript to indicate their earliest API version. 6 7The **picker** module encapsulates APIs of **PhotoViewPicker**, **DocumentViewPicker**, and **AudioViewPicker** to provide capabilities for selecting and saving images and videos, documents, and audio clips. The application can select the picker as required. The APIs of this module must be called in a UIAbility. Otherwise, the **photoPicker** or **FilePicker** application cannot be started. 8 9## Modules to Import 10 11```ts 12import { picker } from '@kit.CoreFileKit'; 13``` 14 15## DocumentViewPicker 16 17Provides APIs for selecting and saving documents in different formats. Before using the APIs of **DocumentViewPicker**, you need to create a **DocumentViewPicker** instance. 18 19**System capability**: SystemCapability.FileManagement.UserFileService 20 21### constructor<sup>12+</sup> 22 23constructor(context: Context) 24 25**Atomic service API**: This API can be used in atomic services since API version 12. 26 27**System capability**: SystemCapability.FileManagement.UserFileService 28 29A constructor used to create a **DocumentViewPicker** instance. This constructor is recommended. For details about how to obtain the context, see [getContext](../apis-arkui/js-apis-getContext.md). 30 31**Example** 32 33```ts 34import { common } from '@kit.AbilityKit'; 35import { picker } from '@kit.CoreFileKit'; 36@Entry 37@Component 38struct Index { 39 @State message: string = 'hello World'; 40 41 build() { 42 Row() { 43 Column() { 44 Text(this.message) 45 .fontSize(50) 46 .fontWeight(FontWeight.Bold) 47 .onClick(()=>{ 48 let context = getContext (this) as common.Context; // Ensure that getContext (this) returns UIAbilityContext. 49 let documentPicker = new picker.DocumentViewPicker(context); 50 }) 51 } 52 .width('100%') 53 } 54 .height('100%') 55 } 56} 57``` 58 59### constructor<sup>12+</sup> 60 61constructor() 62 63**Atomic service API**: This API can be used in atomic services since API version 12. 64 65**System capability**: SystemCapability.FileManagement.UserFileService 66 67A constructor used to create a **DocumentViewPicker** instance. This constructor is not recommended because there is a possibility that the operation fails. 68 69**Example** 70 71```ts 72let documentPicker = new picker.DocumentViewPicker(); // Construction without parameter is not recommended. There is a possibility that the DocumentViewPicker instance fails to start. 73``` 74 75### select 76 77select(option?: DocumentSelectOptions): Promise<Array<string>> 78 79Starts a **documentPicker** page for the user to select one or more documents. This API uses a promise to return the result. You can pass in **DocumentSelectOptions**. 80 81> **NOTE**<br>For details about how to use the returned URIs, see [Using a Document URI](../../file-management/user-file-uri-intro.md#using-a-document-uri). 82 83**Atomic service API**: This API can be used in atomic services since API version 12. 84 85**System capability**: SystemCapability.FileManagement.UserFileService 86 87**Parameters** 88 89| Name | Type | Mandatory| Description | 90| ------- | ------- | ---- | -------------------------- | 91| option | [DocumentSelectOptions](#documentselectoptions) | No | Options for selecting documents. If this parameter is not specified, the **documentPicker** page is displayed by default.| 92 93**Return value** 94 95| Type | Description | 96| ----------------------------- | :---- | 97| Promise<Array<string>> | Promise used to return the URIs of the documents selected.| 98 99**Example** 100 101```ts 102import { BusinessError } from '@kit.BasicServicesKit'; 103import { common } from '@kit.AbilityKit'; 104import { picker } from '@kit.CoreFileKit'; 105async function example07(context: common.Context) {// Ensure that context is converted from UIAbilityContext. 106 try { 107 let documentSelectOptions = new picker.DocumentSelectOptions(); 108 let documentPicker = new picker.DocumentViewPicker(context); 109 documentPicker.select(documentSelectOptions).then((documentSelectResult: Array<string>) => { 110 console.info('DocumentViewPicker.select successfully, documentSelectResult uri: ' + JSON.stringify(documentSelectResult)); 111 }).catch((err: BusinessError) => { 112 console.error('DocumentViewPicker.select failed with err: ' + JSON.stringify(err)); 113 }); 114 } catch (error) { 115 let err: BusinessError = error as BusinessError; 116 console.error('DocumentViewPicker failed with err: ' + JSON.stringify(err)); 117 } 118} 119``` 120 121### select 122 123select(option: DocumentSelectOptions, callback: AsyncCallback<Array<string>>): void 124 125Starts a **documentPicker** page for the user to select one or more documents. This API uses an asynchronous callback to return the result. You can pass in **DocumentSelectOptions**. 126 127> **NOTE**<br>For details about how to use the returned URIs, see [Using a Document URI](../../file-management/user-file-uri-intro.md#using-a-document-uri). 128 129**Atomic service API**: This API can be used in atomic services since API version 12. 130 131**System capability**: SystemCapability.FileManagement.UserFileService 132 133**Parameters** 134 135| Name | Type | Mandatory| Description | 136| ------- | ------- | ---- | -------------------------- | 137| option | [DocumentSelectOptions](#documentselectoptions) | Yes | Options for selecting documents.| 138| callback | AsyncCallback<Array<string>> | Yes | Callback invoked to return the URIs of the documents selected.| 139 140**Example** 141 142```ts 143import { BusinessError } from '@kit.BasicServicesKit'; 144import { common } from '@kit.AbilityKit'; 145import { picker } from '@kit.CoreFileKit'; 146async function example08(context: common.Context) {// Ensure that context is converted from UIAbilityContext. 147 try { 148 let documentSelectOptions = new picker.DocumentSelectOptions(); 149 let documentPicker = new picker.DocumentViewPicker(context); 150 documentPicker.select(documentSelectOptions, (err: BusinessError, documentSelectResult: Array<string>) => { 151 if (err) { 152 console.error('DocumentViewPicker.select failed with err: ' + JSON.stringify(err)); 153 return; 154 } 155 console.info('DocumentViewPicker.select successfully, documentSelectResult uri: ' + JSON.stringify(documentSelectResult)); 156 }); 157 } catch (error) { 158 let err: BusinessError = error as BusinessError; 159 console.error('DocumentViewPicker failed with err: ' + JSON.stringify(err)); 160 } 161} 162``` 163 164### select 165 166select(callback: AsyncCallback<Array<string>>): void 167 168Starts a **documentPicker** page for the user to select one or more documents. This API uses an asynchronous callback to return the result. 169 170> **NOTE**<br>For details about how to use the returned URIs, see [Using a Document URI](../../file-management/user-file-uri-intro.md#using-a-document-uri). 171 172**Atomic service API**: This API can be used in atomic services since API version 12. 173 174**System capability**: SystemCapability.FileManagement.UserFileService 175 176**Parameters** 177 178| Name | Type | Mandatory| Description | 179| ------- | ------- | ---- | -------------------------- | 180| callback | AsyncCallback<Array<string>> | Yes | Callback invoked to return the URIs of the documents selected.| 181 182**Example** 183 184```ts 185import { BusinessError } from '@kit.BasicServicesKit'; 186import { common } from '@kit.AbilityKit'; 187import { picker } from '@kit.CoreFileKit'; 188async function example09(context: common.Context) {// Ensure that context is converted from UIAbilityContext. 189 try { 190 let documentPicker = new picker.DocumentViewPicker(context); 191 documentPicker.select((err: BusinessError, documentSelectResult: Array<string>) => { 192 if (err) { 193 console.error('DocumentViewPicker.select failed with err: ' + JSON.stringify(err)); 194 return; 195 } 196 console.info('DocumentViewPicker.select successfully, documentSelectResult uri: ' + JSON.stringify(documentSelectResult)); 197 }); 198 } catch (error) { 199 let err: BusinessError = error as BusinessError; 200 console.error('DocumentViewPicker failed with err: ' + JSON.stringify(err)); 201 } 202} 203``` 204 205### save 206 207save(option?: DocumentSaveOptions): Promise<Array<string>> 208 209Starts a **documentPicker** page for the user to save one or more documents. This API uses a promise to return the result. You can pass in **DocumentSaveOptions** to specify the file names to save. 210 211> **NOTE**<br>For details about how to use the returned URIs, see [Using a Document URI](../../file-management/user-file-uri-intro.md#using-a-document-uri). 212 213**Atomic service API**: This API can be used in atomic services since API version 12. 214 215**System capability**: SystemCapability.FileManagement.UserFileService 216 217**Parameters** 218 219| Name | Type | Mandatory| Description | 220| ------- | ------- | ---- | -------------------------- | 221| option | [DocumentSaveOptions](#documentsaveoptions) | No | Options for saving the documents. If this parameter is not specified, a **documentPicker** page will be displayed for the user to enter the names of the documents to save.| 222 223**Return value** 224 225| Type | Description | 226| ----------------------------- | :---- | 227| Promise<Array<string>> | Promise used to return the URIs of the documents saved.| 228 229**Example** 230 231```ts 232import { BusinessError } from '@kit.BasicServicesKit'; 233import { common } from '@kit.AbilityKit'; 234import { picker } from '@kit.CoreFileKit'; 235async function example10(context: common.Context) {// Ensure that context is converted from UIAbilityContext. 236 try { 237 let documentSaveOptions = new picker.DocumentSaveOptions(); 238 documentSaveOptions.newFileNames = ['DocumentViewPicker01.txt']; 239 let documentPicker = new picker.DocumentViewPicker(context); 240 documentPicker.save(documentSaveOptions).then((documentSaveResult: Array<string>) => { 241 console.info('DocumentViewPicker.save successfully, documentSaveResult uri: ' + JSON.stringify(documentSaveResult)); 242 }).catch((err: BusinessError) => { 243 console.error('DocumentViewPicker.save failed with err: ' + JSON.stringify(err)); 244 }); 245 } catch (error) { 246 let err: BusinessError = error as BusinessError; 247 console.error('DocumentViewPicker failed with err: ' + JSON.stringify(err)); 248 } 249} 250``` 251 252### save 253 254save(option: DocumentSaveOptions, callback: AsyncCallback<Array<string>>): void 255 256Starts a **documentPicker** page for the user to save one or more documents. This API uses an asynchronous callback to return the result. You can pass in **DocumentSaveOptions** to specify the file names to save. 257 258> **NOTE**<br>For details about how to use the returned URIs, see [Using a Document URI](../../file-management/user-file-uri-intro.md#using-a-document-uri). 259 260**Atomic service API**: This API can be used in atomic services since API version 12. 261 262**System capability**: SystemCapability.FileManagement.UserFileService 263 264**Parameters** 265 266| Name | Type | Mandatory| Description | 267| ------- | ------- | ---- | -------------------------- | 268| option | [DocumentSaveOptions](#documentsaveoptions) | Yes | Options for saving the documents.| 269| callback | AsyncCallback<Array<string>> | Yes | Callback invoked to return the URIs of the documents saved.| 270 271**Example** 272 273```ts 274import { BusinessError } from '@kit.BasicServicesKit'; 275import { common } from '@kit.AbilityKit'; 276import { picker } from '@kit.CoreFileKit'; 277async function example11(context: common.Context) {// Ensure that context is converted from UIAbilityContext. 278 try { 279 let documentSaveOptions = new picker.DocumentSaveOptions(); 280 documentSaveOptions.newFileNames = ['DocumentViewPicker02.txt']; 281 let documentPicker = new picker.DocumentViewPicker(context); 282 documentPicker.save(documentSaveOptions, (err: BusinessError, documentSaveResult: Array<string>) => { 283 if (err) { 284 console.error('DocumentViewPicker.save failed with err: ' + JSON.stringify(err)); 285 return; 286 } 287 console.info('DocumentViewPicker.save successfully, documentSaveResult uri: ' + JSON.stringify(documentSaveResult)); 288 }); 289 } catch (error) { 290 let err: BusinessError = error as BusinessError; 291 console.error('DocumentViewPicker failed with err: ' + JSON.stringify(err)); 292 } 293} 294``` 295 296### save 297 298save(callback: AsyncCallback<Array<string>>): void 299 300Starts a **documentPicker** page for the user to save one or more documents. This API uses an asynchronous callback to return the result. 301 302> **NOTE**<br>For details about how to use the returned URIs, see [Using a Document URI](../../file-management/user-file-uri-intro.md#using-a-document-uri). 303 304**Atomic service API**: This API can be used in atomic services since API version 12. 305 306**System capability**: SystemCapability.FileManagement.UserFileService 307 308**Parameters** 309 310| Name | Type | Mandatory| Description | 311| ------- | ------- | ---- | -------------------------- | 312| callback | AsyncCallback<Array<string>> | Yes | Callback invoked to return the URIs of the documents saved.| 313 314**Example** 315 316```ts 317import { BusinessError } from '@kit.BasicServicesKit'; 318import { common } from '@kit.AbilityKit'; 319import { picker } from '@kit.CoreFileKit'; 320async function example12(context: common.Context) {// Ensure that context is converted from UIAbilityContext. 321 try { 322 let documentPicker = new picker.DocumentViewPicker(context); 323 documentPicker.save((err: BusinessError, documentSaveResult: Array<string>) => { 324 if (err) { 325 console.error('DocumentViewPicker.save failed with err: ' + JSON.stringify(err)); 326 return; 327 } 328 console.info('DocumentViewPicker.save successfully, documentSaveResult uri: ' + JSON.stringify(documentSaveResult)); 329 }); 330 } catch (error) { 331 let err: BusinessError = error as BusinessError; 332 console.error('DocumentViewPicker failed with err: ' + JSON.stringify(err)); 333 } 334} 335``` 336 337## AudioViewPicker 338 339Provides APIs for selecting and saving audio clips. Before using the APIs of **AudioViewPicker**, you need to create an **AudioViewPicker** instance. 340 341**System capability**: SystemCapability.FileManagement.UserFileService 342 343### constructor<sup>12+</sup> 344 345constructor(context: Context) 346 347**Atomic service API**: This API can be used in atomic services since API version 12. 348 349**System capability**: SystemCapability.FileManagement.UserFileService 350 351A constructor used to create an **AudioViewPicker** instance. This constructor is recommended. For details about how to obtain the context, see [getContext](../apis-arkui/js-apis-getContext.md). 352 353**Example** 354 355```ts 356import { common } from '@kit.AbilityKit'; 357import { picker } from '@kit.CoreFileKit'; 358@Entry 359@Component 360struct Index { 361 @State message: string = 'hello World'; 362 363 build() { 364 Row() { 365 Column() { 366 Text(this.message) 367 .fontSize(50) 368 .fontWeight(FontWeight.Bold) 369 .onClick(()=>{ 370 let context = getContext (this) as common.Context; // Ensure that getContext (this) returns UIAbilityContext. 371 let audioPicker = new picker.AudioViewPicker(context); 372 }) 373 } 374 .width('100%') 375 } 376 .height('100%') 377 } 378} 379``` 380### constructor<sup>12+</sup> 381 382constructor() 383 384**Atomic service API**: This API can be used in atomic services since API version 12. 385 386**System capability**: SystemCapability.FileManagement.UserFileService 387 388A constructor used to create an **AudioViewPicker** instance. This constructor is not recommended because there is a possibility that the operation fails. 389 390**Example** 391 392```ts 393let audioPicker = new picker.AudioViewPicker(); // Construction without parameter is not recommended. There is a possibility that the AudioViewPicker instance fails to start. 394``` 395 396### select 397 398select(option?: AudioSelectOptions): Promise<Array<string>> 399 400Starts an **audioPicker** page for the user to select one or more audio clips. This API uses a promise to return the result. You can pass in **AudioSelectOptions**. 401 402> **NOTE**<br>For details about how to use the returned URIs, see [Using a Document URI](../../file-management/user-file-uri-intro.md#using-a-document-uri). 403 404**Atomic service API**: This API can be used in atomic services since API version 12. 405 406**System capability**: SystemCapability.FileManagement.UserFileService 407 408**Parameters** 409 410| Name | Type | Mandatory| Description | 411| ------- | ------- | ---- | -------------------------- | 412| option | [AudioSelectOptions](#audioselectoptions) | No | Options for selecting the audio clips. If this parameter is not specified, the **audioPicker** page is displayed by default. | 413 414**Return value** 415 416| Type | Description | 417| ----------------------------- | :---- | 418| Promise<Array<string>> | Promise used to return the URIs of the audio clips selected.| 419 420**Example** 421 422```ts 423import { BusinessError } from '@kit.BasicServicesKit'; 424import { common } from '@kit.AbilityKit'; 425import { picker } from '@kit.CoreFileKit'; 426async function example13(context: common.Context) {// Ensure that context is converted from UIAbilityContext. 427 try { 428 let audioSelectOptions = new picker.AudioSelectOptions(); 429 let audioPicker = new picker.AudioViewPicker(context); 430 audioPicker.select(audioSelectOptions).then((audioSelectResult: Array<string>) => { 431 console.info('AudioViewPicker.select successfully, audioSelectResult uri: ' + JSON.stringify(audioSelectResult)); 432 }).catch((err: BusinessError) => { 433 console.error('AudioViewPicker.select failed with err: ' + JSON.stringify(err)); 434 }); 435 } catch (error) { 436 let err: BusinessError = error as BusinessError; 437 console.error('AudioViewPicker failed with err: ' + JSON.stringify(err)); 438 } 439} 440``` 441 442### select 443 444select(option: AudioSelectOptions, callback: AsyncCallback<Array<string>>): void 445 446Starts an **audioPicker** page for the user to select one or more audio clips. This API uses an asynchronous callback to return the result. You can pass in **AudioSelectOptions**. 447 448> **NOTE**<br>For details about how to use the returned URIs, see [Using a Document URI](../../file-management/user-file-uri-intro.md#using-a-document-uri). 449 450**System capability**: SystemCapability.FileManagement.UserFileService 451 452**Parameters** 453 454| Name | Type | Mandatory| Description | 455| ------- | ------- | ---- | -------------------------- | 456| option | [AudioSelectOptions](#audioselectoptions) | Yes | Options for selecting audio clips.| 457| callback | AsyncCallback<Array<string>> | Yes | Callback invoked to return the URIs of the audio clips selected.| 458 459**Example** 460 461```ts 462import { BusinessError } from '@kit.BasicServicesKit'; 463import { common } from '@kit.AbilityKit'; 464import { picker } from '@kit.CoreFileKit'; 465async function example14(context: common.Context) {// Ensure that context is converted from UIAbilityContext. 466 try { 467 let audioSelectOptions = new picker.AudioSelectOptions(); 468 let audioPicker = new picker.AudioViewPicker(context); 469 audioPicker.select(audioSelectOptions, (err: BusinessError, audioSelectResult: Array<string>) => { 470 if (err) { 471 console.error('AudioViewPicker.select failed with err: ' + JSON.stringify(err)); 472 return; 473 } 474 console.info('AudioViewPicker.select successfully, audioSelectResult uri: ' + JSON.stringify(audioSelectResult)); 475 }); 476 } catch (error) { 477 let err: BusinessError = error as BusinessError; 478 console.error('AudioViewPicker failed with err: ' + JSON.stringify(err)); 479 } 480} 481``` 482 483### select 484 485select(callback: AsyncCallback<Array<string>>): void 486 487Starts an **audioPicker** page for the user to select one or more audio clips. This API uses an asynchronous callback to return the result. 488 489> **NOTE**<br>For details about how to use the returned URIs, see [Using a Document URI](../../file-management/user-file-uri-intro.md#using-a-document-uri). 490 491**System capability**: SystemCapability.FileManagement.UserFileService 492 493**Parameters** 494 495| Name | Type | Mandatory| Description | 496| ------- | ------- | ---- | -------------------------- | 497| callback | AsyncCallback<Array<string>> | Yes | Callback invoked to return the URIs of the audio clips selected.| 498 499**Example** 500 501```ts 502import { BusinessError } from '@kit.BasicServicesKit'; 503import { common } from '@kit.AbilityKit'; 504import { picker } from '@kit.CoreFileKit'; 505async function example15(context: common.Context) {// Ensure that context is converted from UIAbilityContext. 506 try { 507 let audioPicker = new picker.AudioViewPicker(context); 508 audioPicker.select((err: BusinessError, audioSelectResult: Array<string>) => { 509 if (err) { 510 console.error('AudioViewPicker.select failed with err: ' + JSON.stringify(err)); 511 return; 512 } 513 console.info('AudioViewPicker.select successfully, audioSelectResult uri: ' + JSON.stringify(audioSelectResult)); 514 }); 515 } catch (error) { 516 let err: BusinessError = error as BusinessError; 517 console.error('AudioViewPicker failed with err: ' + JSON.stringify(err)); 518 } 519} 520``` 521 522### save 523 524save(option?: AudioSaveOptions): Promise<Array<string>> 525 526Starts an **audioPicker** page (currently, a **documentPicker** page is displayed) for the user to save one or more audio clips. This API uses a promise to return the result. You can pass in **AudioSaveOptions** to specify the file names of the audio clips to save. 527 528> **NOTE**<br>For details about how to use the returned URIs, see [Using a Document URI](../../file-management/user-file-uri-intro.md#using-a-document-uri). 529 530**Atomic service API**: This API can be used in atomic services since API version 12. 531 532**System capability**: SystemCapability.FileManagement.UserFileService 533 534**Parameters** 535 536| Name | Type | Mandatory| Description | 537| ------- | ------- | ---- | -------------------------- | 538| option | [AudioSaveOptions](#audiosaveoptions) | No | Options for saving audio clips. If this parameter is not specified, an **audioPicker** page will be displayed for the user to enter the names of the files to save.| 539 540**Return value** 541 542| Type | Description | 543| ----------------------------- | ---- | 544| Promise<Array<string>> | Promise used to return the URIs of the audio clips saved.| 545 546**Example** 547 548```ts 549import { BusinessError } from '@kit.BasicServicesKit'; 550import { common } from '@kit.AbilityKit'; 551import { picker } from '@kit.CoreFileKit'; 552async function example16(context: common.Context) {// Ensure that context is converted from UIAbilityContext. 553 try { 554 let audioSaveOptions = new picker.AudioSaveOptions(); 555 audioSaveOptions.newFileNames = ['AudioViewPicker01.mp3']; 556 let audioPicker = new picker.AudioViewPicker(context); 557 audioPicker.save(audioSaveOptions).then((audioSaveResult: Array<string>) => { 558 console.info('AudioViewPicker.save successfully, audioSaveResult uri: ' + JSON.stringify(audioSaveResult)) 559 }).catch((err: BusinessError) => { 560 console.error('AudioViewPicker.save failed with err: ' + JSON.stringify(err)); 561 }); 562 } catch (error) { 563 let err: BusinessError = error as BusinessError; 564 console.error('AudioViewPicker failed with err: ' + JSON.stringify(err)); 565 } 566} 567``` 568 569### save 570 571save(option: AudioSaveOptions, callback: AsyncCallback<Array<string>>): void 572 573Starts an **audioPicker** page (currently, a **documentPicker** page is displayed) for the user to save one or more audio clips. This API uses an asynchronous callback to return the result. You can pass in **AudioSaveOptions** to specify the file names of the audio clips to save. 574 575> **NOTE**<br>For details about how to use the returned URIs, see [Using a Document URI](../../file-management/user-file-uri-intro.md#using-a-document-uri). 576 577**System capability**: SystemCapability.FileManagement.UserFileService 578 579**Parameters** 580 581| Name | Type | Mandatory| Description | 582| ------- | ------- | ---- | -------------------------- | 583| option | [AudioSaveOptions](#audiosaveoptions) | Yes | Options for saving audio clips.| 584| callback | AsyncCallback<Array<string>> | Yes | Callback invoked to return the URIs of the audio clips saved.| 585 586**Example** 587 588```ts 589import { BusinessError } from '@kit.BasicServicesKit'; 590import { common } from '@kit.AbilityKit'; 591import { picker } from '@kit.CoreFileKit'; 592async function example17(context: common.Context) {// Ensure that context is converted from UIAbilityContext. 593 try { 594 let audioSaveOptions = new picker.AudioSaveOptions(); 595 audioSaveOptions.newFileNames = ['AudioViewPicker02.mp3']; 596 let audioPicker = new picker.AudioViewPicker(context); 597 audioPicker.save(audioSaveOptions, (err: BusinessError, audioSaveResult: Array<string>) => { 598 if (err) { 599 console.error('AudioViewPicker.save failed with err: ' + JSON.stringify(err)); 600 return; 601 } 602 console.info('AudioViewPicker.save successfully, audioSaveResult uri: ' + JSON.stringify(audioSaveResult)); 603 }); 604 } catch (error) { 605 let err: BusinessError = error as BusinessError; 606 console.error('AudioViewPicker failed with err: ' + JSON.stringify(err)); 607 } 608} 609``` 610 611### save 612 613save(callback: AsyncCallback<Array<string>>): void 614 615Starts an **audioPicker** page (currently, a **documentPicker** page is displayed) for the user to save one or more audio clips. This API uses an asynchronous callback to return the result. 616 617> **NOTE**<br>For details about how to use the returned URIs, see [Using a Document URI](../../file-management/user-file-uri-intro.md#using-a-document-uri). 618 619**System capability**: SystemCapability.FileManagement.UserFileService 620 621**Parameters** 622 623| Name | Type | Mandatory| Description | 624| ------- | ------- | ---- | -------------------------- | 625| callback | AsyncCallback<Array<string>> | Yes | Callback invoked to return the URIs of the audio clips saved.| 626 627**Example** 628 629```ts 630import { BusinessError } from '@kit.BasicServicesKit'; 631import { common } from '@kit.AbilityKit'; 632import { picker } from '@kit.CoreFileKit'; 633async function example18(context: common.Context) {// Ensure that context is converted from UIAbilityContext. 634 try { 635 let audioPicker = new picker.AudioViewPicker(context); 636 audioPicker.save((err: BusinessError, audioSaveResult: Array<string>) => { 637 if (err) { 638 console.error('AudioViewPicker.save failed with err: ' + JSON.stringify(err)); 639 return; 640 } 641 console.info('AudioViewPicker.save successfully, audioSaveResult uri: ' + JSON.stringify(audioSaveResult)); 642 }); 643 } catch (error) { 644 let err: BusinessError = error as BusinessError; 645 console.error('AudioViewPicker failed with err: ' + JSON.stringify(err)); 646 } 647} 648``` 649 650## DocumentSelectMode<sup>11+</sup> 651 652Enumerates the types of files that can be selected by Picker. 653 654**Atomic service API**: This API can be used in atomic services since API version 12. 655 656**System capability**: SystemCapability.FileManagement.UserFileService.FolderSelection 657 658| Name | Value| Description| 659| ----- | ---- | ---- | 660| FILE | 0 | File. | 661| FOLDER | 1 | Folder. | 662| MIXED | 2 | File and folder. | 663 664## DocumentSelectOptions 665 666Defines the options for selecting documents. 667 668**Atomic service API**: This API can be used in atomic services since API version 12. 669 670**System capability**: SystemCapability.FileManagement.UserFileService 671 672| Name | Type | Mandatory| Description | 673| :---------------------- |---------------------------------------------| ---- |------------------------------------------| 674| maxSelectNumber<sup>10+</sup> | number | No | Maximum number of documents that can be selected.<br>Value range: 1 to 500.<br>Only the devices that have the required system capability can select folders, and only one folder can be selected at a time. <br>Default value: **1**. <br/>**System capability**: SystemCapability.FileManagement.UserFileService | 675| defaultFilePathUri<sup>10+</sup> | string | No | Path of the documents or folder to select. | 676| fileSuffixFilters<sup>10+</sup> | Array<string> | No | File name extension types of the documents to select. <br/>The value is a string array. Each element specifies an option, which includes at most two parts with a vertical bar (\|) in between. The first part is the description (optional), and the second part is the file name extension information. If there is no "\|", the option does not have the description. Multiple file name extensions separated by a commas (,) are allowed in an option. The number of elements in an string array cannot exceed 100. <br/>By default, all documents are selected.<br/>This parameter is available only to the devices that have the required system capability. <br/>**System capability**: SystemCapability.FileManagement.UserFileService | 677| selectMode<sup>11+</sup> | [DocumentSelectMode](#documentselectmode11) | No | Resource types that can be selected, for example, file, folder, or both. The default value is **File**.<br/>This parameter is available only to the devices that have the required system capability. <br/>**System capability**: SystemCapability.FileManagement.UserFileService.FolderSelection | 678| authMode<sup>12+</sup> | boolean | No | Whether to start Picker.<br>Default value: **false**. <br/>If **authMode** is **true**, **defaultFilePathUri** is mandatory, which specifies the URI of the file allowed to access. <br/>This parameter is available only to the devices that have the required system capability.<br>**System capability**: SystemCapability.FileManagement.UserFileService.FolderSelection | 679 680## DocumentPickerMode<sup>12+</sup> 681 682Enumerates the types of files that can be selected by Picker. 683 684**Atomic service API**: This API can be used in atomic services since API version 12. 685 686**System capability**: SystemCapability.FileManagement.UserFileService 687 688| Name | Value| Description| 689| ----- | ---- | ---- | 690| DEFAULT | 0 | Standard mode.| 691| DOWNLOAD | 1 | Download mode.| 692 693## DocumentSaveOptions 694 695Defines the options for saving documents. 696 697**Atomic service API**: This API can be used in atomic services since API version 12. 698 699**System capability**: SystemCapability.FileManagement.UserFileService 700 701| Name | Type | Mandatory| Description | 702| ----------------------- | ------------------- | ---- | ---------------------------- | 703| newFileNames | Array<string> | No | Names of the documents to save. If this parameter is not specified, the user needs to enter the document names. | 704| defaultFilePathUri<sup>10+</sup> | string | No | Path of the documents or folder to save. | 705| fileSuffixChoices<sup>10+</sup> | Array<string> | No | File name extensions of the documents to save.<br/>The value is a string array. Each element specifies an option, which includes at most two parts with a vertical bar which includes at most two parts with a vertical bar (\|) in between. The first part is the description, and the second part is the file name extension information. If there is no "\|", the option does not have the description.<br/>By default, all documents are saved. | 706| pickerMode<sup>12+</sup> | [DocumentPickerMode](#documentpickermode12) | No | Mode for starting Picker.<br>Default value: **DEFAULT**. <br/>If **pickerMode** is **DOWNLOAD**, the settings of **newFileNames**, **defaultFilePathUri**, and **fileSuffixChoices** do not take effect. | 707 708## AudioSelectOptions 709 710Defines the options for selecting audio clips. 711 712**Atomic service API**: This API can be used in atomic services since API version 12. 713 714**System capability**: SystemCapability.FileManagement.UserFileService 715| Name | Type | Mandatory| Description | 716| :---------------------- |---------------------------------------------| ---- |------------------------------------------| 717| maxSelectNumber<sup>12+</sup> | number | No | Maximum number of audio clips that can be selected.<br>Default value: **1**<br>Value range: 1 to 500| 718 719## AudioSaveOptions 720 721Defines the options for saving audio clips. 722 723**Atomic service API**: This API can be used in atomic services since API version 12. 724 725**System capability**: SystemCapability.FileManagement.UserFileService 726 727| Name | Type | Mandatory| Description | 728| ----------------------- | ------------------- | ---- | ---------------------------- | 729| newFileNames | Array<string> | No | Names of the audio clips to save. If this parameter is not specified, the user needs to enter the file names.| 730 731## PhotoViewPicker<sup>(deprecated)</sup> 732 733Provides APIs for selecting and saving images/videos. You are advised to use [PhotoViewPicker of PhotoAccessHelper](../apis-media-library-kit/js-apis-photoAccessHelper.md#photoviewpicker) to select files. Before using the APIs of **PhotoViewPicker**, you need to create a **PhotoViewPicker** instance. 734 735> **NOTE** 736> 737> This API is supported since API version 9 and deprecated since API version 12. Use [photoAccessHelper.PhotoViewPicker](../apis-media-library-kit/js-apis-photoAccessHelper.md#photoviewpicker) instead. 738 739**System capability**: SystemCapability.FileManagement.UserFileService 740 741### constructor<sup>12+</sup> 742 743constructor(context: Context) 744 745**Atomic service API**: This API can be used in atomic services since API version 12. 746 747**System capability**: SystemCapability.FileManagement.UserFileService 748 749A constructor used to create a **PhotoViewPicker** instance. This constructor is recommended. For details about how to obtain the context, see [getContext](../apis-arkui/js-apis-getContext.md). 750 751**Example** 752 753```ts 754import { common } from '@kit.AbilityKit'; 755import { picker } from '@kit.CoreFileKit'; 756@Entry 757@Component 758struct Index { 759 @State message: string = 'hello World'; 760 761 build() { 762 Row() { 763 Column() { 764 Text(this.message) 765 .fontSize(50) 766 .fontWeight(FontWeight.Bold) 767 .onClick(()=>{ 768 let context = getContext (this) as common.Context; // Ensure that getContext (this) returns UIAbilityContext. 769 let photoPicker = new picker.PhotoViewPicker(context); 770 }) 771 } 772 .width('100%') 773 } 774 .height('100%') 775 } 776} 777``` 778 779### constructor<sup>12+</sup> 780 781constructor() 782 783**System capability**: SystemCapability.FileManagement.UserFileService 784 785A constructor used to create a **PhotoViewPicker** instance. This constructor is not recommended because there is a possibility that the operation fails. 786 787**Example** 788 789```ts 790let photoPicker = new picker.PhotoViewPicker(); // Construction without parameter is not recommended. There is a possibility that the PhotoViewPicker instance fails to start. 791``` 792 793### select<sup>(deprecated)</sup> 794 795select(option?: PhotoSelectOptions): Promise<PhotoSelectResult> 796 797Starts a **photoPicker** page for the user to select one or more images/videos. This API uses a promise to return the result. You can pass in **PhotoSelectOptions** to specify the type and maximum number of the files to select. 798 799> **NOTE** 800> 801> This API is supported since API version 9 and deprecated since API version 12. Use [photoAccessHelper.PhotoViewPicker#select](../apis-media-library-kit/js-apis-photoAccessHelper.md#select) instead. 802> 803> The **photoUris** in the **PhotoSelectResult** object returned by this API can be used only by [photoAccessHelper.getAssets](../apis-media-library-kit/js-apis-photoAccessHelper.md#getassets). For details, see [Using a Media File URI](../../file-management/user-file-uri-intro.md#using-a-media-file-uri). 804 805**Atomic service API**: This API can be used in atomic services since API version 11. 806 807**System capability**: SystemCapability.FileManagement.UserFileService 808 809**Parameters** 810 811| Name | Type | Mandatory| Description | 812| ------- | ------- | ---- | -------------------------- | 813| option | [PhotoSelectOptions](#photoselectoptionsdeprecated) | No | Options for selecting images/videos. By default, images and videos are selected, and the maximum number of files that can be selected is 50.| 814 815**Return value** 816 817| Type | Description | 818| ----------------------------- | :---- | 819| Promise<[PhotoSelectResult](#photoselectresultdeprecated)> | Promise used to return a **PhotoSelectResult** object.| 820 821**Example** 822 823```ts 824import { BusinessError } from '@kit.BasicServicesKit'; 825import { common } from '@kit.AbilityKit'; 826import { picker } from '@kit.CoreFileKit'; 827async function example01(context: common.Context) {// Ensure that context is converted from UIAbilityContext. 828 try { 829 let photoSelectOptions = new picker.PhotoSelectOptions(); 830 photoSelectOptions.MIMEType = picker.PhotoViewMIMETypes.IMAGE_TYPE; 831 photoSelectOptions.maxSelectNumber = 5; 832 let photoPicker = new picker.PhotoViewPicker(context); 833 photoPicker.select(photoSelectOptions).then((photoSelectResult: picker.PhotoSelectResult) => { 834 console.info('PhotoViewPicker.select successfully, photoSelectResult uri: ' + JSON.stringify(photoSelectResult)); 835 }).catch((err: BusinessError) => { 836 console.error('PhotoViewPicker.select failed with err: ' + JSON.stringify(err)); 837 }); 838 } catch (error) { 839 let err: BusinessError = error as BusinessError; 840 console.error('PhotoViewPicker failed with err: ' + JSON.stringify(err)); 841 } 842} 843``` 844 845### select<sup>(deprecated)</sup> 846 847select(option: PhotoSelectOptions, callback: AsyncCallback<PhotoSelectResult>): void 848 849Starts a **photoPicker** page for the user to select one or more images/videos. This API uses an asynchronous callback to return the result. You can pass in **PhotoSelectOptions** to specify the type and maximum number of the files to select. 850 851> **NOTE** 852> 853> This API is supported since API version 9 and deprecated since API version 12. Use [photoAccessHelper.PhotoViewPicker#select](../apis-media-library-kit/js-apis-photoAccessHelper.md#select-1) instead. 854> 855> The **photoUris** in the **PhotoSelectResult** object returned by this API can be used only by [photoAccessHelper.getAssets](../apis-media-library-kit/js-apis-photoAccessHelper.md#getassets). For details, see [Using a Media File URI](../../file-management/user-file-uri-intro.md#using-a-media-file-uri). 856 857**Atomic service API**: This API can be used in atomic services since API version 11. 858 859**System capability**: SystemCapability.FileManagement.UserFileService 860 861**Parameters** 862 863| Name | Type | Mandatory| Description | 864| ------- | ------- | ---- | -------------------------- | 865| option | [PhotoSelectOptions](#photoselectoptionsdeprecated) | Yes | Options for selecting images/videos.| 866| callback | AsyncCallback<[PhotoSelectResult](#photoselectresultdeprecated)> | Yes | Callback invoked to return a **PhotoSelectResult** object.| 867 868**Example** 869 870```ts 871import { BusinessError } from '@kit.BasicServicesKit'; 872import { common } from '@kit.AbilityKit'; 873import { picker } from '@kit.CoreFileKit'; 874async function example02(context: common.Context) {// Ensure that context is converted from UIAbilityContext. 875 try { 876 let photoSelectOptions = new picker.PhotoSelectOptions(); 877 photoSelectOptions.MIMEType = picker.PhotoViewMIMETypes.IMAGE_TYPE; 878 photoSelectOptions.maxSelectNumber = 5; 879 let photoPicker = new picker.PhotoViewPicker(context); 880 photoPicker.select(photoSelectOptions, (err: BusinessError, photoSelectResult: picker.PhotoSelectResult) => { 881 if (err) { 882 console.error('PhotoViewPicker.select failed with err: ' + JSON.stringify(err)); 883 return; 884 } 885 console.info('PhotoViewPicker.select successfully, photoSelectResult uri: ' + JSON.stringify(photoSelectResult)); 886 }); 887 } catch (error) { 888 let err: BusinessError = error as BusinessError; 889 console.error('PhotoViewPicker failed with err: ' + JSON.stringify(err)); 890 } 891} 892``` 893 894### select<sup>(deprecated)</sup> 895 896select(callback: AsyncCallback<PhotoSelectResult>): void 897 898Starts a **photoPicker** page for the user to select one or more images/videos. This API uses an asynchronous callback to return the result. 899 900> **NOTE** 901> 902> This API is supported since API version 9 and deprecated since API version 12. Use [photoAccessHelper.PhotoViewPicker#select](../apis-media-library-kit/js-apis-photoAccessHelper.md#select-2) instead. 903> 904> The **photoUris** in the **PhotoSelectResult** object returned by this API can be used only by [photoAccessHelper.getAssets](../apis-media-library-kit/js-apis-photoAccessHelper.md#getassets). For details, see [Using a Media File URI](../../file-management/user-file-uri-intro.md#using-a-media-file-uri). 905 906**Atomic service API**: This API can be used in atomic services since API version 11. 907 908**System capability**: SystemCapability.FileManagement.UserFileService 909 910**Parameters** 911 912| Name | Type | Mandatory| Description | 913| ------- | ------- | ---- | -------------------------- | 914| callback | AsyncCallback<[PhotoSelectResult](#photoselectresultdeprecated)> | Yes | Callback invoked to return a **PhotoSelectResult** object.| 915 916**Example** 917 918```ts 919import { BusinessError } from '@kit.BasicServicesKit'; 920import { common } from '@kit.AbilityKit'; 921import { picker } from '@kit.CoreFileKit'; 922async function example03(context: common.Context) {// Ensure that context is converted from UIAbilityContext. 923 try { 924 let photoPicker = new picker.PhotoViewPicker(context); 925 photoPicker.select((err: BusinessError, photoSelectResult: picker.PhotoSelectResult) => { 926 if (err) { 927 console.error('PhotoViewPicker.select failed with err: ' + JSON.stringify(err)); 928 return; 929 } 930 console.info('PhotoViewPicker.select successfully, photoSelectResult uri: ' + JSON.stringify(photoSelectResult)); 931 }); 932 } catch (error) { 933 let err: BusinessError = error as BusinessError; 934 console.error('PhotoViewPicker failed with err: ' + JSON.stringify(err)); 935 } 936} 937``` 938 939### save<sup>(deprecated)</sup> 940 941save(option?: PhotoSaveOptions): Promise<Array<string>> 942 943Starts a **photoPicker** page for the user to save one or more images/videos. This API uses a promise to return the result. You can pass in **PhotoSaveOptions** to specify the file names of the images/videos to save. 944 945> **NOTE** 946> 947> This API is supported since API version 9 and deprecated since API version 12. Use [SaveButton](../apis-arkui/arkui-ts/ts-security-components-savebutton.md#savebutton) instead. 948> 949> This API saves files in **Files**, not in **Gallery**. For details about how to use the returned URIs, see [Using a Document URI](../../file-management/user-file-uri-intro.md#using-a-document-uri). 950 951**System capability**: SystemCapability.FileManagement.UserFileService 952 953**Parameters** 954 955| Name | Type | Mandatory| Description | 956| ------- | ------- | ---- | -------------------------- | 957| option | [PhotoSaveOptions](#photosaveoptionsdeprecated) | No | Options for saving files. If this parameter is not specified, a **photoPicker** page will be displayed for the user to enter the names of the files to save.| 958 959**Return value** 960 961| Type | Description | 962| ----------------------------- | :---- | 963| Promise<Array<string>> | Promise used to return the URIs of the files saved.| 964 965**Example** 966 967```ts 968import { BusinessError } from '@kit.BasicServicesKit'; 969import { common } from '@kit.AbilityKit'; 970import { picker } from '@kit.CoreFileKit'; 971async function example04(context: common.Context) {// Ensure that context is converted from UIAbilityContext. 972 try { 973 let photoSaveOptions = new picker.PhotoSaveOptions(); 974 photoSaveOptions.newFileNames = ['PhotoViewPicker01.jpg', 'PhotoViewPicker01.mp4']; 975 let photoPicker = new picker.PhotoViewPicker(context); 976 photoPicker.save(photoSaveOptions).then((photoSaveResult: Array<string>) => { 977 console.info('PhotoViewPicker.save successfully, photoSaveResult uri: ' + JSON.stringify(photoSaveResult)); 978 }).catch((err: BusinessError) => { 979 console.error('PhotoViewPicker.save failed with err: ' + JSON.stringify(err)); 980 }); 981 } catch (error) { 982 let err: BusinessError = error as BusinessError; 983 console.error('PhotoViewPicker failed with err: ' + JSON.stringify(err)); 984 } 985} 986``` 987 988### save<sup>(deprecated)</sup> 989 990save(option: PhotoSaveOptions, callback: AsyncCallback<Array<string>>): void 991 992Starts a **photoPicker** page for the user to save one or more images/videos. This API uses an asynchronous callback to return the result. You can pass in **PhotoSaveOptions** to specify the file names of the images/videos to save. 993 994> **NOTE** 995> 996> This API is supported since API version 9 and deprecated since API version 12. Use [SaveButton](../apis-arkui/arkui-ts/ts-security-components-savebutton.md#savebutton) instead. 997> 998> This API saves files in **Files**, not in **Gallery**. For details about how to use the returned URIs, see [Using a Document URI](../../file-management/user-file-uri-intro.md#using-a-document-uri). 999 1000**System capability**: SystemCapability.FileManagement.UserFileService 1001 1002**Parameters** 1003 1004| Name | Type | Mandatory| Description | 1005| ------- | ------- | ---- | -------------------------- | 1006| option | [PhotoSaveOptions](#photosaveoptionsdeprecated) | Yes | Options for saving images/videos.| 1007| callback | AsyncCallback<Array<string>> | Yes | Callback invoked to return the URIs of the files saved.| 1008 1009**Example** 1010 1011```ts 1012import { BusinessError } from '@kit.BasicServicesKit'; 1013import { common } from '@kit.AbilityKit'; 1014import { picker } from '@kit.CoreFileKit'; 1015async function example05(context: common.Context) {// Ensure that context is converted from UIAbilityContext. 1016 try { 1017 let photoSaveOptions = new picker.PhotoSaveOptions(); 1018 photoSaveOptions.newFileNames = ['PhotoViewPicker02.jpg','PhotoViewPicker02.mp4']; 1019 let photoPicker = new picker.PhotoViewPicker(context); 1020 photoPicker.save(photoSaveOptions, (err: BusinessError, photoSaveResult: Array<string>) => { 1021 if (err) { 1022 console.error('PhotoViewPicker.save failed with err: ' + JSON.stringify(err)); 1023 return; 1024 } 1025 console.info('PhotoViewPicker.save successfully, photoSaveResult uri: ' + JSON.stringify(photoSaveResult)); 1026 }); 1027 } catch (error) { 1028 let err: BusinessError = error as BusinessError; 1029 console.error('PhotoViewPicker failed with err: ' + JSON.stringify(err)); 1030 } 1031} 1032``` 1033 1034### save<sup>(deprecated)</sup> 1035 1036save(callback: AsyncCallback<Array<string>>): void 1037 1038Starts a **photoPicker** page for the user to save one or more images/videos. This API uses an asynchronous callback to return the result. 1039 1040> **NOTE** 1041> 1042> This API is supported since API version 9 and deprecated since API version 12. Use [SaveButton](../apis-arkui/arkui-ts/ts-security-components-savebutton.md#savebutton) instead. 1043> 1044> This API saves files in **Files**, not in **Gallery**. For details about how to use the returned URIs, see [Using a Document URI](../../file-management/user-file-uri-intro.md#using-a-document-uri). 1045 1046**System capability**: SystemCapability.FileManagement.UserFileService 1047 1048**Parameters** 1049 1050| Name | Type | Mandatory| Description | 1051| ------- | ------- | ---- | -------------------------- | 1052| callback | AsyncCallback<Array<string>> | Yes | Callback invoked to return the URIs of the files saved.| 1053 1054**Example** 1055 1056```ts 1057import { BusinessError } from '@kit.BasicServicesKit'; 1058import { common } from '@kit.AbilityKit'; 1059import { picker } from '@kit.CoreFileKit'; 1060async function example06(context: common.Context) {// Ensure that context is converted from UIAbilityContext. 1061 try { 1062 let photoPicker = new picker.PhotoViewPicker(context); 1063 photoPicker.save((err: BusinessError, photoSaveResult: Array<string>) => { 1064 if (err) { 1065 console.error('PhotoViewPicker.save failed with err: ' + JSON.stringify(err)); 1066 return; 1067 } 1068 console.info('PhotoViewPicker.save successfully, photoSaveResult uri: ' + JSON.stringify(photoSaveResult)); 1069 }); 1070 } catch (error) { 1071 let err: BusinessError = error as BusinessError; 1072 console.error('PhotoViewPicker failed with err: ' + JSON.stringify(err)); 1073 } 1074} 1075``` 1076 1077## PhotoViewMIMETypes<sup>(deprecated)</sup> 1078 1079Enumerates the media file types that can be selected. 1080 1081> **NOTE** 1082> 1083> This API is supported since API version 9 and deprecated since API version 12. Use [photoAccessHelper.PhotoViewMIMETypes](../apis-media-library-kit/js-apis-photoAccessHelper.md#photoviewmimetypes) instead. 1084 1085**Atomic service API**: This API can be used in atomic services since API version 11. 1086 1087**System capability**: SystemCapability.FileManagement.UserFileService 1088 1089| Name | Value| Description| 1090| ----- | ---- | ---- | 1091| IMAGE_TYPE | 'image/*' | Image. | 1092| VIDEO_TYPE | 'video/*' | Video. | 1093| IMAGE_VIDEO_TYPE | '\*/*' | Image and video. | 1094 1095## PhotoSelectOptions<sup>(deprecated)</sup> 1096 1097Defines the options for selecting images/videos. 1098 1099> **NOTE** 1100> 1101> This API is supported since API version 9 and deprecated since API version 12. Use [photoAccessHelper.PhotoSelectOptions](../apis-media-library-kit/js-apis-photoAccessHelper.md#photoselectoptions) instead. 1102 1103**Atomic service API**: This API can be used in atomic services since API version 11. 1104 1105**System capability**: SystemCapability.FileManagement.UserFileService 1106 1107| Name | Type | Mandatory| Description | 1108| ----------------------- | ------------------- | ---- | -------------------------------- | 1109| MIMEType | [PhotoViewMIMETypes](#photoviewmimetypesdeprecated) | No | Types of the media files to select. **IMAGE_VIDEO_TYPE** is used by default. | 1110| maxSelectNumber | number | No | Maximum number of media files to select. The default value is **50**, and the maximum value is **500**. | 1111 1112## PhotoSelectResult<sup>(deprecated)</sup> 1113 1114Defines information about the images/videos selected. 1115 1116> **NOTE** 1117> 1118> This API is supported since API version 9 and deprecated since API version 12. Use [photoAccessHelper.PhotoSelectResult](../apis-media-library-kit/js-apis-photoAccessHelper.md#photoselectresult) instead. 1119 1120**Atomic service API**: This API can be used in atomic services since API version 11. 1121 1122**System capability**: SystemCapability.FileManagement.UserFileService 1123 1124| Name | Type | Mandatory| Description | 1125| ----------------------- | ------------------- | ----| ------------------------------ | 1126| photoUris | Array<string> | Yes | Array of the URIs of the images/videos selected. This URI array can be used only by [photoAccessHelper.getAssets](../apis-media-library-kit/js-apis-photoAccessHelper.md#getassets). For details, see [Using a Media File URI](../../file-management/user-file-uri-intro.md#using-a-media-file-uri). | 1127| isOriginalPhoto | boolean | Yes | Whether the selected image is the original one. The value **true** means the selected image is the original one, and **false** means the opposite. | 1128 1129## PhotoSaveOptions<sup>(deprecated)</sup> 1130 1131Defines the options for saving images or videos. 1132 1133> **NOTE** 1134> 1135> This API is supported since API version 9 and deprecated since API version 12. There is no substitute API. 1136 1137**System capability**: SystemCapability.FileManagement.UserFileService 1138 1139| Name | Type | Mandatory| Description | 1140| ----------------------- | ------------------- | ---- | ---------------------------- | 1141| newFileNames | Array<string> | No | Names of the files to save. If this parameter is not specified, the user needs to enter the file names.| 1142