---
title: "fileContentsType(forPathExtension:)"
framework: appkit
role: symbol
role_heading: Type Method
path: "appkit/nspasteboard/pasteboardtype/filecontentstype(forpathextension:)"
---

# fileContentsType(forPathExtension:)

Returns a pasteboard type based on the passed file type.

## Declaration

```swift
static func fileContentsType(forPathExtension fileType: String) -> NSPasteboard.PasteboardType!
```

## Discussion

Discussion Returns an NSString to a pasteboard type representing a file’s contents based on the supplied string fileType. fileType should generally be the extension part of a filename. The conversion from a named file type to a pasteboard type is simple; no mapping to standard pasteboard types is attempted.

## See Also

### Functions

- [NSConvertGlyphsToPackedGlyphs(_:_:_:_:)](appkit/nsconvertglyphstopackedglyphs(_:_:_:_:).md)
- [raiseBadArgumentException(_:_:_:)](appkit/nsaccessibility-swift.struct/raisebadargumentexception(_:_:_:).md)
- [NSReleaseAlertPanel(_:)](appkit/nsreleasealertpanel(_:).md)
- [NSDisableScreenUpdates()](appkit/nsdisablescreenupdates().md)
- [NSEnableScreenUpdates()](appkit/nsenablescreenupdates().md)
- [NSDrawColorTiledRects(_:_:_:_:_:)](appkit/nsdrawcolortiledrects(_:_:_:_:_:).md)
- [NSSetShowsServicesMenuItem(_:_:)](appkit/nssetshowsservicesmenuitem(_:_:).md)
- [NSCopyBits(_:_:_:)](appkit/nscopybits(_:_:_:).md)
- [NSShowsServicesMenuItem(_:)](appkit/nsshowsservicesmenuitem(_:).md)
- [NSDottedFrameRect(_:)](appkit/nsdottedframerect(_:).md)
- [NSReadPixel(_:)](appkit/nsreadpixel(_:).md)
- [NSGetWindowServerMemory(_:_:_:_:)](appkit/nsgetwindowservermemory(_:_:_:_:).md)
- [fileNameType(forPathExtension:)](appkit/nspasteboard/pasteboardtype/filenametype(forpathextension:).md)
- [representedPathExtension](appkit/nspasteboard/pasteboardtype/representedpathextension.md)
- [representedPathExtensions(from:)](appkit/nspasteboard/pasteboardtype/representedpathextensions(from:).md)
