> ## Documentation Index
> Fetch the complete documentation index at: https://help.dingtalk.io/llms.txt
> Use this file to discover all available pages before exploring further.

# Upload attachments

> Describes how to upload attachments in AI Table, covering the write path for attachment fields and the required parameters.

This document describes how to upload attachments in AI Table.

Uploading an attachment in AI Table works similarly to the action shown below.

Uploading an attachment involves three steps:

1. Get the upload information. For details, see the [Get resource upload information](/open/development/api-getresourceuploadinfo) API.
2. Upload the local file to the `uploadUrl` returned in step 1. Use a `PUT` request to upload the local file.

   The following is an example using the `cURL` command (the @ symbol in the example is required).

   ```bash theme={"theme":{"light":"github-light","dark":"github-dark"}}
   curl -X PUT -H "Content-Type: image/jpeg" --data-binary @/path/to/your/image.jpg {uploadUrl returned in step 1}
   ```
3. Call the [Insert records](/open/development/api-notable-insertrecords) and [Update multiple records](/open/development/api-noatable-updaterecords) APIs to write the attachment into AI Table.

   The format of the record value is as follows.

   ```json lines theme={"theme":{"light":"github-light","dark":"github-dark"}}
   [
     {
         "filename": "pikaqiu.jpg", // The resourceName passed in step 1
         "size": 200, // The size passed in step 1
         "type": "image/jpeg", // The mediaType passed in step 1
         "url": "xxx"，// The resourceUrl returned in step 1. Note: this is not uploadUrl. For example, /core/api/resources/img/xxx
         "resourceId": "xxx" // The resourceId returned in step 1. For example, 9ee6c515-4ebd-47a0-b8c3-5383c4241d84
     }
   ]
   ```
