xref: /curl/docs/cmdline-opts/ftp-method.md (revision e7219c2b)
1---
2c: Copyright (C) Daniel Stenberg, <daniel@haxx.se>, et al.
3SPDX-License-Identifier: curl
4Long: ftp-method
5Arg: <method>
6Help: Control CWD usage
7Protocols: FTP
8Added: 7.15.1
9Category: ftp
10Multi: single
11See-also:
12  - list-only
13Example:
14  - --ftp-method multicwd ftp://example.com/dir1/dir2/file
15  - --ftp-method nocwd ftp://example.com/dir1/dir2/file
16  - --ftp-method singlecwd ftp://example.com/dir1/dir2/file
17---
18
19# `--ftp-method`
20
21Control what method curl should use to reach a file on an FTP(S)
22server. The method argument should be one of the following alternatives:
23
24## multicwd
25Do a single CWD operation for each path part in the given URL. For deep
26hierarchies this means many commands. This is how RFC 1738 says it should be
27done. This is the default but the slowest behavior.
28
29## nocwd
30Do no CWD at all. curl does SIZE, RETR, STOR etc and gives the full path to
31the server for each of these commands. This is the fastest behavior.
32
33## singlecwd
34Do one CWD with the full target directory and then operate on the file
35"normally" (like in the multicwd case). This is somewhat more standards
36compliant than `nocwd` but without the full penalty of `multicwd`.
37