---
sourceDocument: Xanadu API Reference
sourceDocumentLink: https://servicenow-prod.fluidtopics.net/r/xanadu/api-reference

 Release :

    - xanadu

ft:locale :

    - en-US

ft:publication_title :

    - Xanadu API Reference

ft:clusterId :

    - crapiref

bundleId :

    - crapiref

workflow :

    - Creator


---

# NowAttachmentUploadConfiguration structure - iOS

# NowAttachmentUploadConfiguration structure - iOS {#ariaid-title1}

* Release version: Xanadu
* 
* Updated August 1, 2024
* 
* ![](https://www.servicenow.com/docs/portal-asset/ico-clock) 1 minute to read

The NowAttachmentUploadConfiguration structure enables you to define
the configuration information for an attachment that you are uploading to your ServiceNow instance.  
{#NowAttachUploadConfigiOSStruct__table_vx2_klw_5pb__entry__3}

| Name | Type | Description |
|-|-|-|
| contentType | String | HTTP data content type. |
| encryptionContext | String | Optional. Sys_id of an encryption context record. Specify this parameter to allow only users with the specified encryption context to access the attachment. Default: Attached file is not encrypted with any encryption context. |
| fileName | String | Name of the attachment file. |
| recordSysId | String | Sys_id of the record on the ServiceNow instance to associate the attachment with. |
| tableName | String | Name of the table on the ServiceNow instance that contains the record specified in the recordSysid parameter. |
[Table 1. Properties]

{#NowAttachUploadConfigiOSStruct__table_vx2_klw_5pb}

## NowAttachmentUploadConfiguration init(tableName: String, recordSysId: SysID, fileName:
String, contentType: String, encryptionContext: String?) {#ariaid-title2}

Sets the upload configuration values for the specified attachment.
{#NAUC-init_S_S_S_S_S__table_shs_cgn_mqb__entry__3}

| Name | Type | Description |
|-|-|-|
| tableName | String | Name of the table on the ServiceNow instance that contains the record specified in the recordSysid parameter. |
| recordSysId | String | Sys_id of the record on the ServiceNow instance to associate the attachment with. |
| fileName | String | Name of the attachment file. |
| contentType | String | HTTP data content type. |
| encryptionContext | String | Optional. Sys_id of an encryption context record. Specify this parameter to allow only users with the specified encryption context to access the attachment. Default: Attached file is not encrypted with any encryption context. |
[Table 2. Parameters]

{#NAUC-init_S_S_S_S_S__table_shs_cgn_mqb} {#NAUC-init_S_S_S_S_S__table_ths_cgn_mqb__entry__2}

| Type | Description |
|-|-|
| None |   |
[Table 3. Returns]

{#NAUC-init_S_S_S_S_S__table_ths_cgn_mqb}  
The following code example shows how to call this function.

    let recordSysId = "" // Sys_id of the record on the SN instance

    let config = NowAttachmentUploadConfiguration(
      tableName: "tableName", 
      recordSysId: recordSysId, 
      fileName: "photo.png",
      contentType: "image/png", 
      encryptionContext: nil)


