Topics   All   Mac OS X (Only)   Windows (Only)   Linux (Only, Not)   iOS (Only, Not)  
Components   Crossplatform Mac & Win   Server   Client   Old   Guides   Examples
New in version: 8.2   8.3   8.4   8.5   9.0   9.1   9.2   9.3   9.4   9.5    Statistic  


Copies files and folders without user interface.

Component Version macOS Windows Server FileMaker Cloud FileMaker iOS SDK
Files 2.8 Yes Yes Yes Yes Yes
MBS( "Files.CopyFile"; SourcePath; DestPath { ; Overwrite; SkipSourcePermissionErrors; ProgressTitle } )   More


Parameter Description Example value
SourcePath The native path to the file or folder to be copied. "/Users/John/Desktop/test.txt"
DestPath The native path to the destination folder or file. "/Users/John/Desktop/Backup/"
Overwrite Optional
Mac only: Whether to allow overwriting existing files. Default is off. Pass 1 to enable and 0 to disable.
(ignored on other platforms)
SkipSourcePermissionErrors Optional
Mac only: Whether to skip files with permission errors. Default is off. Pass 1 to enable and 0 to disable.
ProgressTitle Optional
Title for the progress window.
For Windows only and the text may not be visible in your version of Windows.
"Copying FileMake files"


Returns OK or error message.


Copies files and folders without user interface.
SourcePath and DestPath must be valid and exist. So pass destination folder for the destination.
This function needs a native path. Please use Path.FileMakerPathToNativePath function in order to convert a FileMaker style path to a native path.

The Linux implementation copies file to dest. You need to have read permissions for source file. We try to preserve extended attributes and file permissions.

On Windows the 5th parameter can be 1 to use alternative copy function from Windows. This one is for copying one file only, but may be more successful in some cases.


Copy a file:

MBS( "Files.CopyFile"; "/Users/cs/Desktop/test.pdf"; "/Users/cs/Desktop/copy.pdf")

Copy file on Windows with alternative copy method:

MBS( "Files.CopyFile"; "D:\Arbeitsunterlagen\Problemloesungsbericht_SDAG_WM.xlsx"; "D:\Files_for_ZIP/CC__8D_1997_01_02__LU_53145345__2_97.xlsx"; 0; 0; 1)

See also

Example Databases

Blog Entries

Release notes

Created 18th August 2014, last changed 9th May 2019

Files.CanOpenFile   -   Files.CreateAlias

Feedback: Report problem or ask question.

MBS FileMaker Plugins