---
title: "attachments"
canonical: "https://help.fieldbuddy.com/space/FBDOCS/5670830130/attachments"
format: markdown
---
Determines the way how attachments are displayed

```json
"attachments": {
  "batching": {
    "enabled": true,
    "failureThreshold": 5,
    "timeout": {
      "min": 60000,
      "max": 300000
    },
    "onEthernet": {
      "count": 25,
      "size": 35
    },
    "onWifi": {
      "count": 10,
      "size": 20
    },
    "onCellular": {
      "count": 5,
      "size": 10
    }
  },
  "maxAttempts": 10,
  "minAttachmentsToShowUploadInProgress": 6,
  "uploadToastVisibility": "always",
  "attemptUploadAfterSync": true,
  "pdfMode": "preview",
  "cropOption": true,
  "compression": 0.5,
  "heicCompression": 0.5,
  "maxPictures": 45,
  "allowPhotosUpload": true,
  "allowFilesUpload": true,
  "maxUploadFileSize": 35,
  "maxDownloadFileSize": 10,
  "useInefficientFullImageThumbnails": false,
  "supportedFilesTypes": [
    "pdf",
    "xlsx",
    "docx",
    "pptx",
    "txt",
    "power_point_x",
    "excel_x",
    "word_x",
    "text",
    "rtf",
    "ods",
    "csv",
    "odp",
    "epub",
    "odt",
    "unknown",
    "xml",
    "png",
    "jpg",
    "jpeg",
    "gif",
    "bmp",
    "tiff",
    "svg",
    "webp",
    "heif",
    "heic",
    "ico",
    "json",
    "zip"
  ]
}
```

| Property | Description. | Sample Value | default |
| --- | --- | --- | --- |
| **minAttachmentsToShowUploadInProgress** | Shows a toast message instructing the user not to close the app while the attachment is uploading only if the count of the attachments is **>=** **minAttachmentsToShowUploadInProgress**. | ```
"minAttachmentsToShowUploadInProgress":"10"
``` | ```
minAttachmentsToShowUploadInProgress: 6
``` |
| **uploadToastVisibility** | Defines uploading pop-up visibility:<br>- “none”: completely remove it
- “errorsOnly”: show it only when error occurs
- “always”: always show it - success, progress, error (verbose) | ```
"uploadToastVisibility": "none"
``` | ```
"uploadToastVisibility": "errorsOnly"
``` |
| **attemptUploadAfterSync** | If true, pending and retrying attachments will be reattempted to be uploaded after every sync. | ```
"attemptUploadAfterSync": true
``` | ```
"attemptUploadAfterSync": true
``` |
| **pdfMode** | Determines the way we display PDFs in the browser<br>it supports either "download" OR "preview" | ```
"pdfMode":"preview"
``` | ```
 "pdfMode":"download"
``` |
| **cropOption**<br>> ⚠️ deprecated | Determines if we allow the user to crop the picture. After the picture is taken with the camera. | ```
"cropOption": true
``` | ```
"cropOption": true
``` |
| **allowFilesUpload** | Displays or not a new file button in attachments page | ```
"allowFilesUpload": true
``` | ```
"allowFilesUpload": true
``` |
| **allowPhotosUpload** | Displays or not new file button and media library upload button in attachments page | ```
 "allowPhotosUpload": true
``` | ```
 "allowPhotosUpload": true
``` |
| **maxUploadFileSize** | Maximum size of file to upload in MB<br>> ⚠️ Maximum value: 35 | ```
  "maxUploadFileSize": 35
``` | ```
  "maxUploadFileSize": 35
``` |
| **maxDownloadFileSize** | Maximum size of file to download. in MB | ```
"maxDownloadFileSize": 100
``` | ```
"maxDownloadFileSize": 100
``` |
| **supportedFilesTypes** | The list of files selectable for a file upload should be filtered out based on this list | ```
  "supportedFilesTypes": [
      "pdf",
      "docx",
      "png",
      "jpg",
      "jpeg"
  ]
``` | ```
"attachments": {	  		  
supportedFilesTypes: 
[ "pdf", "xlsx", "docx",
 "pptx", "txt", "power_point_x", 
 "excel_x", "word_x", "text",
"rtf", "ods", "csv", "odp",
 "epub", "odt", "unknown", "xml",
"png", "jpg", "jpeg", "gif", 
"bmp", "tiff", "svg", 
 "webp", "heif", 
 "heic", "ico",
"json", "zip"]
}
``` |
| **readonlyExceptions** | Allow the user to edit, delete or add an attachment in a closed Work Order | ```
"readonlyExceptions": {
    "onEdit": true,
    "onDelete": false,
    "onAdd": true
}
``` | ```
"readonlyExceptions": {
    "onEdit": false,
    "onDelete": false,
    "onAdd": false
},
``` |
| **compression** | Allow to specify quality of uploaded photos/pictures for jpg format, FieldBuddy Swift will compress the pictures accordingly. | ```
"compression": 0.5,
``` | ```
"compression": 1 // full quality
``` |
| **heicCompression** | Allow to specify quality of uploaded photos/pictures for heic format. FieldBuddy Swift will compress the pictures accordingly. | ```
"heicCompression": 0.5
``` | ```
"heicCompression": 1 //full quality
``` |
| **maxPictures** | Allow to specify the maximum limit for the number of pictures that can be selected in the gallery.<br>> ⚠️ On Android, a very large limit  
> ⚠️ (> 100) will cause the limit to be set to the maximum that the system supports. Similarly, you can set it to 0 to have the actual system's limit. | ```
"maxPictures": 10
``` | ```
"maxPictures": 45
``` |
| **useInefficientFullImageThumbnails** | > ⚠️ Turning this setting on will slow down the initial rendering speed of attachments in attachment lists if they need to be downloaded first.<br>Starting from version `3.504.1.1`, when Swift downloads images, it downloads a smaller version of it to improve download performance. This behavior may be turned off by setting this to `true`. | true | false |
| #### **batching** | Allows to specify settings like:<br>- `enabled`: if `false`, batching will be disabled. Disabling batching is <u>not recommended</u>, as it will cause performance issues.
- `failureThreshold`: the upload attempt threshold after which an attachment is no longer included within batches with other attachments, and will always be deprioritized. Lowering this value will improve the chance of successful uploads, but decrease the performance of the app while an upload is taking place.
- `timeout`: the min and max duration (in milliseconds) of upload for an attachment in batch, after which Swift will stop listening for an upload response back from the server, and move on to the next batch.
- `onEthernet`: the max count and size of batches when user is uploading attachments using Ethernet. Size is in MBs. Max value for count is 35. Max value for size is 25.
- `onWifi`: the max count and size of batches when user is uploading attachments using Wi-Fi. Size is in MBs. Max value for count is 35. Max value for size is 25.
- `onCellular`: the max count and size of batches when user is uploading attachments using Cellular. Size is in MBs. Max value for count is 35. Max value for size is 25. This is the default used setting if connection type cannot be determined. | ```json
batching: {
  enabled: true,
  failureThreshold: 5,
  timeout: {
    min: 60000,
    max: 300000,
  },
  onEthernet: {
    count: 25,
    size: 35,
  },
  onWifi: {
    count: 10,
    size: 20,
  },
  onCellular: {
    count: 5,
    size: 10,
  },
}
``` | ```json
batching: {
  enabled: true,
  failureThreshold: 5,
  timeout: {
    min: 60000,
    max: 300000,
  },
  onEthernet: {
    count: 25,
    size: 35,
  },
  onWifi: {
    count: 10,
    size: 20,
  },
  onCellular: {
    count: 5,
    size: 10,
  },
}
``` |
| maxAttempts | Determines how may times an attachment will be put back into upload queue before deeming it “failed”. | `maxAttempts: 15` | `maxAttempts: 10` |

## Presets for Batching and Fault Tolerance

You can use the presets below depending on the following factors affecting the users that use the configuration:

- General network conditions:
  - Whether users have to work with spotty/unstable network, or if they have access to high quality network.
- Fault tolerance:
  - How assertive/persistent should attachments/batches behave during automatic uploads.

## Default/Balanced Batching + Moderate Fault Tolerance + Reasonable Timeouts

✅ Good balance of performance vs. bad network resiliency.

✅ Good eventual upload success chance.

```
"attachments": {
  "maxAttempts": 10,
  "batching": {
    "enabled": true,
    "failureThreshold": 5,
    "timeout": {
      "min": 60000,
      "max": 300000,
    },
    "onEthernet": {
      "count": 25,
      "size": 35
    },
    "onWifi": {
      "count": 10,
      "size": 20
    },
    "onCellular": {
      "count": 5,
      "size": 10
    },
  },
}
```

## Aggressive Batching + Moderate Fault Tolerance + Reasonable Timeouts

⭐️ Best performance out of all presets, thanks to aggressive batching.

✅ Good eventual upload success chance.

❌ Aggressive batching will lead to more failed uploads if user has bad network conditions, or does not wait for uploads to finish.

```
"attachments": {
  "maxAttempts": 10,
  "batching": {
    "enabled": true,
    "failureThreshold": 5,
    "timeout": {
      "min": 60000,
      "max": 300000,
    },
    "onEthernet": {
      "count": 25,
      "size": 35
    },
    "onWifi": {
      "count": 25,
      "size": 35
    },
    "onCellular": {
      "count": 25,
      "size": 35
    },
  },
}
```

## No batching + Moderate Fault Tolerance + Reasonable Timeouts

⭐️ Best individual success rate of upload out of all presets, thanks to no batching.

✅ Good eventual upload success chance.

❌ Lack of batching will lead to poor performance in the app while there is an active upload.

```
"attachments": {
  "maxAttempts": 10,
  "batching": {
    "enabled": false,
    "failureThreshold": 1,
    "timeout": {
      "min": 60000,
      "max": 300000,
    }
    "onEthernet": {
      "count": 1,
      "size": 35
    },
    "onWifi": {
      "count": 1,
      "size": 20
    },
    "onCellular": {
      "count": 1,
      "size": 10
    },
  },
}
```

## Default/Balanced Batching + Very Low Fault Tolerance + Reasonable Timeouts 

⭐️ Best for increasing the success chance of most recent uploads.

✅ Good balance of performance vs. bad network resiliency.

❌ Not ideal for having the least recent uploads automatically and eventually success. This is because the user will need to manually try attempting uploads later – as at an early point they will not be automatically retried to be uploaded.

```
"attachments": {
  "maxAttempts": 2,
  "batching": {
    "enabled": true,
    "failureThreshold": 1,
    "timeout": {
      "min": 60000,
      "max": 300000,
    }
    "onEthernet": {
      "count": 25,
      "size": 35
    },
    "onWifi": {
      "count": 10,
      "size": 20
    },
    "onCellular": {
      "count": 5,
      "size": 10
    },
  },
}
```

## Default/Balanced Batching + Very High Fault Tolerance + Reasonable Timeouts 

⭐️ Best for having the least recent failing uploads have the eventual chance of successful upload.

✅ Good balance of performance vs. bad network resiliency.

❌ Not ideal for increasing the success chance of most recent uploads.

```
"attachments": {
  "maxAttempts": 25,
  "batching": {
    "enabled": true,
    "failureThreshold": 10,
    "timeout": {
      "min": 60000,
      "max": 300000,
    }
    "onEthernet": {
      "count": 25,
      "size": 35
    },
    "onWifi": {
      "count": 10,
      "size": 20
    },
    "onCellular": {
      "count": 5,
      "size": 10
    },
  },
}
```

## Default/Balanced Batching + Very High Fault Tolerance + Fast Timeouts 

⭐️ Best for fast processing of batches, or upload speed.

✅ Good balance of performance vs. bad network resiliency.

❌ Uploads may fail more often.

```
"attachments": {
  "maxAttempts": 25,
  "batching": {
    "enabled": true,
    "failureThreshold": 10,
    "timeout": {
      "min": 30000,
      "max": 90000,
    }
    "onEthernet": {
      "count": 25,
      "size": 35
    },
    "onWifi": {
      "count": 10,
      "size": 20
    },
    "onCellular": {
      "count": 5,
      "size": 10
    },
  },
}
```

# Upload Toast Settings Presets

You can use the presets below depending on the following factors affecting the users that use the configuration:

- Whether users like to know upload status frequently or not;
- Whether users need to know about upload failures directly to take action.

## Curious Cat

All cases of upload progress, success, error, etc. are shown to the user. 

✅ Encourages users to keep the app in the foreground until every upload finishes.

❌ Can get annoying for some users over time.

```
"attachments": {
  "uploadToastVisibility": "always",
  "minAttachmentsToShowUploadInProgress": 1
}
```

## Default/Balanced Toasts

Only upload errors are shown to the user. 

✅ Users are aware of upload errors and can take action.

❌ Users may not wait for uploads to finish; lowering the upload success rate.

Can get annoying for some users over time.

```
"attachments": {
  "uploadToastVisibility": "errorsOnly"
}
```

## Unaware Ostrich

User sees no toasts about uploads. 

✅ The least distruptive option for the user.

❌ Can be problematic if user doesn’t try to reupload the failed media, assuming they uploaded.

```
"attachments": {
  "uploadToastVisibility": "none"
}
```