CURL.SetBatchDestinationPath
----------------------------

Sets the destination path for batch downloads.

| Component | Version | macOS | Windows | Linux | Server | iOS SDK |
|---|---|---|---|---|---|---|
| [CURL](component_CURL.md) | [7.0](newinversion70.md) | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes |

MBS( "CURL.SetBatchDestinationPath"; curl; Path ) 

**MBS**( **"CURL.SetBatchDestinationPath";** /\* Sets the destination path for batch downloads. \*/  
**$curl**; /\* The CURL session handle. \*/   
**$Path**) /\* The path to destination folder.e.g. "/Users/cs/Desktop/" \*/ 

### Parameters

| Parameter | Description | Example |
|---|---|---|
| curl | The CURL session handle. | $curl |
| Path | The path to destination folder. | "/Users/cs/Desktop/" |

### Result

Returns OK or error.

### Description

Sets the destination path for batch downloads.  
See also [CURL.SetOptionWildCardMatch](CURLSetOptionWildCardMatch.md).  
  
This function requires a native path. Use [Path.FileMakerPathToNativePath](PathFileMakerPathToNativePath.md) to convert a FileMaker path to a native path if required. If you like to have the user choose the path, you can use [FileDialog](component_FileDialog.md) functions.  
For Server be aware that server has limited permissions and may not be able to access all files on a computer.  
### Examples

Download several files via FTP:

 Set Variable \[$curl ; Value:MBS ("[CURL.New](CURLNew.md)")\]  
\#Set URL with wildcard match   
Set Variable \[$result ; Value:MBS ("[CURL.SetOptionURL](CURLSetOptionURL.md)"; $curl ; CURL Test::URL )\]  
\#Set folder where to put files   
Set Variable \[$result ; Value:MBS ("CURL.SetBatchDestinationPath"; $curl ; CURL Test::DestPath )\]  
\#credentials...   
Set Variable \[$result ; Value:MBS ("[CURL.SetOptionPassword](CURLSetOptionPassword.md)"; $curl ; CURL Test::Password )\]  
Set Variable \[$result ; Value:MBS ("[CURL.SetOptionUserName](CURLSetOptionUserName.md)"; $curl ; CURL Test::Name )\]  
\#enable wildcard match   
Set Variable \[$result ; Value:MBS ("[CURL.SetOptionWildCardMatch](CURLSetOptionWildCardMatch.md)"; $curl ; 1)\]  
\#download them all   
Set Field \[CURL Test::Result ; MBS ("[CURL.Perform](CURLPerform.md)"; $curl )\]  
\#check results   
Set Field \[CURL Test::debug ; MBS ("[CURL.GetDebugMessages](CURLGetDebugMessages.md)"; $curl )\]  
Set Field \[CURL Test::FileNames ; MBS ("[CURL.GetBatchFileNames](CURLGetBatchFileNames.md)"; $curl )\]  
Set Variable \[$result ; Value:MBS ("[CURL.Release](CURLRelease.md)"; $curl )\]  
### See also

- [CURL.GetBatchDestinationPath](CURLGetBatchDestinationPath.md)
- [CURL.GetBatchFileNames](CURLGetBatchFileNames.md)
- [CURL.GetDebugMessages](CURLGetDebugMessages.md)
- [CURL.New](CURLNew.md)
- [CURL.Release](CURLRelease.md)
- [CURL.SetOptionPassword](CURLSetOptionPassword.md)
- [CURL.SetOptionURL](CURLSetOptionURL.md)
- [CURL.SetOptionUserName](CURLSetOptionUserName.md)
- [CURL.SetOptionWildCardMatch](CURLSetOptionWildCardMatch.md)
- [Path.FileMakerPathToNativePath](PathFileMakerPathToNativePath.md)

### Release notes

- **Version 7.0**
    - Added functions for batch download of files over FTP: [CURL.GetBatchCurrentFileName](http://www.mbsplugins.eu/CURLGetBatchCurrentFileName.shtml), [CURL.GetBatchCurrentFilePath](http://www.mbsplugins.eu/CURLGetBatchCurrentFilePath.shtml), [CURL.GetBatchDestinationPath](http://www.mbsplugins.eu/CURLGetBatchDestinationPath.shtml), [CURL.GetBatchFileNames](http://www.mbsplugins.eu/CURLGetBatchFileNames.shtml) and [CURL.SetBatchDestinationPath](http://www.mbsplugins.eu/CURLSetBatchDestinationPath.shtml).

### Example Databases

- [CURL/FTP/CURL FTP Download all Files in Directory](https://www.mbsplugins.eu/MBS-FileMaker-Plugin-Examples/CURL/FTP/CURL%20FTP%20Download%20all%20Files%20in%20Directory.shtml#2ScriptAnchor_)

### Blog Entries

- [MBS FileMaker Plugin, version 7.0pr1](https://www.mbsplugins.de/archive/2017-01-02/MBS_FileMaker_Plugin_version_7/monkeybreadsoftware_blog_filemaker)

This function checks for a license.

Created 19th December 2016 , last changed 3th January 2023

  
[CURL.SendText](CURLSendText.md) - [CURL.SetDebugWithData](CURLSetDebugWithData.md)

[HTML Version](CURLSetBatchDestinationPath.shtml)