---
title: "fileDataRepresentation(with:)"
framework: avfoundation
role: symbol
role_heading: Instance Method
path: "avfoundation/avcapturephoto/filedatarepresentation(with:)"
---

# fileDataRepresentation(with:)

Gets a customized representation of the photo data.

## Declaration

```swift
func fileDataRepresentation(with customizer: any AVCapturePhotoFileDataRepresentationCustomizer) -> Data?
```

## Parameters

- `customizer`: An object that customizes the returned metadata, image thumbnail, or depth data.

## Mentioned in

Capturing photos in RAW and Apple ProRAW formats Configuring camera capture to collect a Portrait Effects matte

## Return Value

Return Value A data representation of the photo.

## See Also

### Packaging data for file output

- [AVCapturePhotoFileDataRepresentationCustomizer](avfoundation/avcapturephotofiledatarepresentationcustomizer.md)
- [fileDataRepresentation()](avfoundation/avcapturephoto/filedatarepresentation().md)
- [cgImageRepresentation()](avfoundation/avcapturephoto/cgimagerepresentation().md)
- [previewCGImageRepresentation()](avfoundation/avcapturephoto/previewcgimagerepresentation().md)
- [fileDataRepresentation(withReplacementMetadata:replacementEmbeddedThumbnailPhotoFormat:replacementEmbeddedThumbnailPixelBuffer:replacementDepthData:)](avfoundation/avcapturephoto/filedatarepresentation(withreplacementmetadata:replacementembeddedthumbnailphotoformat:replacementembeddedthumbnailpixelbuffer:replacementdepthdata:).md)
