<!--
{
  "availability" : [
    "macOS: -"
  ],
  "documentType" : "symbol",
  "framework" : "IOBluetooth",
  "identifier" : "/documentation/IOBluetooth/OBEXFileTransferServices/copyRemoteFile(_:toLocalPath:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "IOBluetooth"
    ],
    "preciseIdentifier" : "c:objc(cs)OBEXFileTransferServices(im)copyRemoteFile:toLocalPath:"
  },
  "title" : "copyRemoteFile(_:toLocalPath:)"
}
-->

# copyRemoteFile(_:toLocalPath:)

Copy a remote file to a local path

```
func copyRemoteFile(_ inRemoteFileName: String!, toLocalPath inLocalPathAndName: String!) -> OBEXError
```

## Parameters

`inRemoteFileName`

The name of the remote file to get

`inLocalPathAndName`

The path and name of where the received file will go

## Return Value

kOBEXSuccess, kOBEXSessionBusyError, or kOBEXBadArgumentError. initially. Further results returned through the fileTransferServicesGetComplete: and fileTransferServicesGetProgress: delegate methods if initially successful.

## Discussion

Equivalent to ‘cp remotePath/remoteFileName localPathAndName’.

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)