Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 15 additions & 14 deletions Project/Sources/Methods/test.4dm
Original file line number Diff line number Diff line change
@@ -1,21 +1,22 @@
//%attributes = {}
var $ftp : cs:C1710.FileTransfer_curl
var $ftp_c : cs:C1710.FileTransfer_curl
var $ftp_r : cs:C1710.FileTransfer_rclone
var $progressid; $source; $target; $answer; $text; $path : Text
var $checkstop; $result : Object
var $list : Collection

$ftp:=cs:C1710.FileTransfer_curl.new("download.4d.com"; ""; ""; "https")
$ftp_c:=cs:C1710.FileTransfer_curl.new("download.4d.com"; ""; ""; "https")

$progressid:="Download 4D.dmg"
$checkstop:=New shared object:C1526("stop"; False:C215)
$ftp.enableStopButton($checkstop)
$ftp.useCallback(Formula:C1597(ProgressCallback); $progressid)
$ftp_c.enableStopButton($checkstop)
$ftp_c.useCallback(Formula:C1597(ProgressCallback); $progressid)

$source:="/Products/4D_v19R5/Installers/4D_v19_R5_Mac.dmg"
$target:=System folder:C487(Desktop:K41:16)+"4d.dmg"
$target:=Convert path system to POSIX:C1106($target)
$ftp.setCurlPrefix("--location") // follow 301 or 302
$result:=$ftp.download($source; $target)
$ftp_c.setCurlPrefix("--location") // follow 301 or 302
$result:=$ftp_c.download($source; $target)

// did user canceled?
If ($checkstop.stop=True:C214)
Expand All @@ -28,10 +29,10 @@ Else
End if


$ftp:=cs:C1710.FileTransfer_rclone.new("gdrive")
$ftp_r:=cs:C1710.FileTransfer_rclone.new("gdrive")
$path:="/users/thomas/Desktop/rclone-v1.59.1-osx-arm64/rclone"
$ftp.setPath($path)
$result:=$ftp.getDirectoryListing("/")
$ftp_r.setPath($path)
$result:=$ftp_r.getDirectoryListing("/")
If ($result.success)
$list:=$result.list
$text:=JSON Stringify:C1217($list)
Expand All @@ -42,18 +43,18 @@ Else
End if


$ftp:=cs:C1710.FileTransfer_rclone.new("gdrive")
$ftp_r:=cs:C1710.FileTransfer_rclone.new("gdrive")
$path:="/users/thomas/Desktop/rclone-v1.59.1-osx-arm64/rclone"
$ftp.setPath($path)
$ftp_r.setPath($path)
$progressid:="Download zipg"
$checkstop:=New shared object:C1526("stop"; False:C215)
$ftp.enableStopButton($checkstop)
$ftp.useCallback(Formula:C1597(ProgressCallback); $progressid)
$ftp_r.enableStopButton($checkstop)
$ftp_r.useCallback(Formula:C1597(ProgressCallback); $progressid)

$source:="/16-10_CookieBaseWebAuth.zip"
$target:=System folder:C487(Desktop:K41:16)+"test.zip"
$target:=Convert path system to POSIX:C1106($target)
$result:=$ftp.download($source; $target)
$result:=$ftp_r.download($source; $target)

// did user canceled?
If ($checkstop.stop=True:C214)
Expand Down
Loading