Skip to content

Commit 2835af8

Browse files
committed
before testing Windows
1 parent d565e51 commit 2835af8

7 files changed

Lines changed: 74 additions & 18 deletions

File tree

Data/data.4DD

0 Bytes
Binary file not shown.

Data/data.journal

132 Bytes
Binary file not shown.

Readme.MD

Lines changed: 55 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,48 @@
1-
## FTP/STP Class
2-
(using cURL - providing an easy to use wrapper)
1+
# FTP/SFTP/FTPS Class
2+
Using cURL - providing an easy to use wrapper
3+
4+
## Introduktion
5+
cURL is a standard tool to access files via many different protocols and is preinstalled on macOS and Windows (in Windows 10, Windows 11, Windows Server 2019 and 2022).
6+
7+
The preinstalled cURL version supports FTP and FTPS. By installing "your" own version SFTP will be supported additionally.
8+
Precompiled versions for Windows can be downloaded from:
9+
[curl.se](https://curl.se/download.html)
10+
which allows to use Windows Server 2012 or 2016.
11+
12+
To use SFTP on Mac you need to install [Homebrew](https://brew.sh) and run:
13+
```
14+
homebrew install curl
15+
```
16+
17+
This class allows easy usage of cURL to transfer files to and from FTP and FTPS servers.
18+
19+
# Usage example
20+
21+
```4D
22+
var $ftp : cs.FileTransfer
23+
$ftp:=cs.FileTransfer.new("ftp.4d.com"; "username"; "password"; "ftps")
24+
$source:="/product/4D.dmg"
25+
$target:=Convert path system to POSIX(System folder(Desktop))
26+
$result:=$ftp.download($source; $target)
27+
If ($result.success)
28+
...
29+
End if
30+
```
31+
32+
# Feature set
33+
- Upload
34+
- Download
35+
- Directory Listing
36+
- Rename and Delete (file and directory)
37+
- Many settings (Timeout, bandwidth, range)
38+
39+
# Installation
40+
41+
Copy class
42+
43+
# Full documentation
44+
345

4-
Work in progress
546

647
To do:
748

@@ -11,10 +52,6 @@ To do:
1152
(delayed - on Mac there is a buffer, not useable to display progress)
1253
Example callback uses 4D progress
1354

14-
15-
16-
17-
overwrite curl
1855

1956
test windows
2057

@@ -37,6 +74,17 @@ If this option is used several times, the last one will be used.
3774

3875
-y/--speed-time <time>
3976

77+
78+
79+
80+
brew install curl
81+
/opt/homebrew/opt/curl/bin/curl --version
82+
curl 7.81.0 (arm-apple-darwin21.1.0) libcurl/7.81.0 (SecureTransport) OpenSSL/1.1.1m zlib/1.2.11 brotli/1.0.9 zstd/1.5.2 libidn2/2.3.2 libssh2/1.10.0 nghttp2/1.46.0 librtmp/2.3 OpenLDAP/2.6.1
83+
Release-Date: 2022-01-05
84+
Protocols: dict file ftp ftps gopher gophers http https imap imaps ldap ldaps mqtt pop3 pop3s rtmp rtsp scp sftp smb smbs smtp smtps telnet tftp
85+
Features: alt-svc AsynchDNS brotli GSS-API HSTS HTTP2 HTTPS-proxy IDN IPv6 Kerberos Largefile libz MultiSSL NTLM NTLM_WB SPNEGO SSL TLS-SRP UnixSockets zstd
86+
87+
4088
If a download is slower than speed-limit bytes per second during a speed-time period, the download gets aborted. If speed-time is used, the default speed-limit will be 1 unless set with -y.
4189

4290
This option controls transfers and thus will not affect slow connects etc. If this is a concern for you, try the --connect-timeout option.

userPreferences.Thomas/methodPreferences.json

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
{
22
"Sources/Classes/FileTransfer.4dm": {
3-
"startSelection": 54,
4-
"endSelection": 54,
5-
"firstSelectedLine": 20,
6-
"lastSelectedLine": 20,
3+
"startSelection": 22,
4+
"endSelection": 0,
5+
"firstSelectedLine": 9,
6+
"lastSelectedLine": 0,
77
"folding": [
88
12,
99
20,
@@ -30,10 +30,10 @@
3030
"stamp": "2022-02-07T11:19:32.904Z"
3131
},
3232
"Sources/Methods/test.4dm": {
33-
"startSelection": 5,
34-
"endSelection": 5,
35-
"firstSelectedLine": 26,
36-
"lastSelectedLine": 26,
33+
"startSelection": 0,
34+
"endSelection": 20,
35+
"firstSelectedLine": 80,
36+
"lastSelectedLine": 81,
3737
"folding": [],
3838
"bookmarks": [],
3939
"stamp": "2022-02-07T11:21:35.129Z"

userPreferences.Thomas/methodWindowPositions.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"Sources/Classes/FileTransfer.4dm": {
3-
"left": 837,
4-
"top": 276,
3+
"left": 1827,
4+
"top": 316,
55
"width": 1554,
66
"height": 956
77
},

userPreferences.Thomas/preferences.4DPreferences

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<?xml version="1.0" encoding="UTF-8"?><preferences stamp="16">
1+
<?xml version="1.0" encoding="UTF-8"?><preferences stamp="20">
22
<com.4d>
33
<database>
44
<data_storage data_path="Data/data.4DD"/>

userPreferences.Thomas/workspace.json

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,14 @@
1212
{
1313
"type": "explorer"
1414
},
15+
{
16+
"type": "method",
17+
"id": 2147483647,
18+
"codeDescriptor": {
19+
"type": 1,
20+
"methodName": "test"
21+
}
22+
},
1523
{
1624
"type": "method",
1725
"id": 2147483643,

0 commit comments

Comments
 (0)