Skip to content

Commit 5490bc9

Browse files
committed
Documentation and example improvements, no code change, so still 1.0.1, no update of the compiled component
1 parent 0afdf83 commit 5490bc9

4 files changed

Lines changed: 7 additions & 20 deletions

File tree

Project/Sources/Methods/test.4dm

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
//%attributes = {}

Project/Sources/Methods/test_curl.4dm

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -65,8 +65,6 @@ If (False:C215)
6565
End if
6666

6767
If (False:C215)
68-
//$ftp.useCallback(Formula(ProgressCallback); "ProgressCallback")
69-
7068
$source:="/test2.txt"
7169
$target:=System folder:C487(Desktop:K41:16)+"newtest2.txt"
7270
$target:=Convert path system to POSIX:C1106($target)
@@ -80,7 +78,6 @@ If (False:C215)
8078
$source:="/test[1-3].txt"
8179
//$source:="/large/4D.dmg"
8280
//$ftp.setRange("-100")
83-
//$source:="/share/MD0_DATA/Archiv/Diverses_ohne_Backup/test/test[1-3].txt"
8481

8582
$target:=System folder:C487(Desktop:K41:16)+"neu"+Folder separator:K24:12
8683
$target:=Convert path system to POSIX:C1106($target)
@@ -92,7 +89,7 @@ End if
9289

9390
If (True:C214)
9491
$source:="/large/4D.dmg"
95-
//$ftp.setCurlPrefix("--limit-rate 25M") // make it slow for testing - limiting bandwidth
92+
// $ftp.setCurlPrefix("--limit-rate 25M") // make it slow for testing - limiting bandwidth
9693

9794
$progressid:="Download 4D.dmg"
9895
$ftp.useCallback(Formula:C1597(ProgressCallback); $progressid)

Project/Sources/Methods/test_curl_http.4dm

Lines changed: 3 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -50,15 +50,8 @@ If (True:C214) // download with progress, stop button
5050
$ftp:=cs:C1710.FileTransfer_curl.new("download.4d.com"; ""; ""; "https")
5151

5252
$progressid:="Download 4D.dmg"
53-
If (Storage:C1525.FileTransfer_Progress=Null:C1517)
54-
Use (Storage:C1525)
55-
Storage:C1525.FileTransfer_Progress:=New shared object:C1526
56-
End use
57-
End if
58-
// enable stop button in progress bar
59-
Use (Storage:C1525.FileTransfer_Progress)
60-
Storage:C1525.FileTransfer_Progress[$progressid]:=New shared object:C1526()
61-
End use
53+
$checkstop:=New shared object:C1526("stop"; False:C215)
54+
$ftp.enableStopButton($checkstop)
6255
$ftp.useCallback(Formula:C1597(ProgressCallback); $progressid)
6356

6457
$source:="/Products/4D_v19R3/Installers/4D_v19_R3_Mac.dmg"
@@ -68,16 +61,12 @@ If (True:C214) // download with progress, stop button
6861
$result:=$ftp.download($source; $target)
6962

7063
// did user canceled?
71-
If (Bool:C1537(Storage:C1525.FileTransfer_Progress[$progressid].Stop)) // check stop button if it was set, remove from storage
64+
If ($checkstop.stop=True:C214)
7265
// user canceled!!
7366
Else
7467
If ($result.success)
7568
$answer:=$result.data
7669
End if
7770
End if
7871

79-
Use (Storage:C1525.FileTransfer_Progress) // clear storage
80-
OB REMOVE:C1226(Storage:C1525.FileTransfer_Progress; $progressid)
81-
End use
82-
8372
End if

Readme.MD

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,9 @@ Same commands/code can be used to upload/download files, create/rename/move/dele
1616

1717
For FTP/FTPS/HTTPS the system build in cURL version can be used, but also overwritten with another version.
1818

19-
For Dropbox a CLI tool (written in Go) is included.
19+
For Dropbox a CLI tool (written in Go) is used.
2020

21-
For GDrive a CLI tool (written in Go) needs to be installed (requires usage of installer)
21+
For GDrive a CLI tool (written in Go) is used
2222

2323
# Usage example
2424

0 commit comments

Comments
 (0)