|
1 | | -//%attributes = {} |
2 | | -var $ftp : cs:C1710.FileTransfer_Dropbox |
3 | | -$ftp:=cs:C1710.FileTransfer_Dropbox.new() |
4 | | -//$ftp.setPath(" /Users/thomas/Desktop/dbxcli") |
5 | | -
|
6 | | -
|
7 | | -If (False:C215) |
8 | | - $source:="/" |
9 | | - $result:=$ftp.version($source) |
10 | | - If ($result.success) |
11 | | - $answer:=$result.data |
12 | | - End if |
13 | | -End if |
14 | | -
|
15 | | -
|
16 | | -If (False:C215) |
17 | | - $source:="/" |
18 | | - $result:=$ftp.getDirectoryListing($source) |
19 | | - If ($result.success) |
20 | | - $answer:=$result.data |
21 | | - End if |
22 | | -End if |
23 | | -
|
24 | | -
|
25 | | -// upload große datei, progress bar - Windows |
26 | | -If (False:C215) |
27 | | - $ftp.useCallback(Formula:C1597(ProgressCallback); "ProgressCallback") |
28 | | - $source:=System folder:C487(Desktop:K41:16)+"Heap.pdf" |
29 | | - $source:=Convert path system to POSIX:C1106($source) |
30 | | - $target:="/Firma/test2.pdf" |
31 | | - $result:=$ftp.upload($source; $target) |
32 | | - If ($result.success) |
33 | | - $answer:=$result.data |
34 | | - End if |
35 | | -End if |
36 | | -
|
37 | | -If (False:C215) |
38 | | - $ftp.useCallback(Formula:C1597(ProgressCallback); "ProgressCallback") |
39 | | - $target:=System folder:C487(Desktop:K41:16)+"result.pdf" |
40 | | - $target:=Convert path system to POSIX:C1106($target) |
41 | | - $source:="/Firma/test2.pdf" |
42 | | - $result:=$ftp.download($source; $target) |
43 | | - If ($result.success) |
44 | | - $answer:=$result.data |
45 | | - End if |
46 | | -End if |
47 | | -
|
48 | | -
|
49 | | -If (True:C214) |
50 | | - // only Windows, Callback not available on Mac |
51 | | - $ftp.useCallback(Formula:C1597(ProgressCallback); "Download 4D.dmg") |
52 | | - $ftp.setAsyncMode(True:C214) |
53 | | - |
54 | | - $source:=System folder:C487(Desktop:K41:16)+"Heap.pdf" |
55 | | - $source:=Convert path system to POSIX:C1106($source) |
56 | | - $target:="/Firma/test2.pdf" |
57 | | - $result:=$ftp.upload($source; $target) |
58 | | - |
59 | | - // async, so we need to loop... |
60 | | - // normally we are supposed to do something else and either |
61 | | - // check from time to time or to use the callback method to inform us (percent=100) |
62 | | - Repeat |
63 | | - $ftp.wait(1) // needed while our process is running |
64 | | - // wait is not needed if a form would be open or if a worker would handle the job |
65 | | - $status:=$ftp.status() |
66 | | - |
67 | | - Until (Bool:C1537($status.terminated)) |
68 | | - |
69 | | -End if |
70 | | -
|
71 | | -If (False:C215) |
72 | | - $target:="/Firma/newdir" |
73 | | - $result:=$ftp.createDirectory($target) |
74 | | - If ($result.success) |
75 | | - $answer:=$result.data |
76 | | - End if |
77 | | -End if |
78 | | -
|
79 | | -If (False:C215) |
80 | | - $target:="/Firma/newdir" |
81 | | - $result:=$ftp.deleteDirectory($target; True:C214) // delete even with content |
82 | | - If ($result.success) |
83 | | - $answer:=$result.data |
84 | | - End if |
85 | | -End if |
86 | | -
|
87 | | -If (False:C215) |
88 | | - $target:="/Firma/test2.pdf" |
89 | | - $result:=$ftp.deleteFile($target) |
90 | | - If ($result.success) |
91 | | - $answer:=$result.data |
92 | | - End if |
93 | | -End if |
| 1 | +//%attributes = {} |
| 2 | +var $ftp : cs:C1710.FileTransfer_Dropbox |
| 3 | +$ftp:=cs:C1710.FileTransfer_Dropbox.new() |
| 4 | +//$ftp.setPath(" /Users/thomas/Desktop/dbxcli") |
| 5 | + |
| 6 | + |
| 7 | +If (False:C215) |
| 8 | + $source:="/" |
| 9 | + $result:=$ftp.version($source) |
| 10 | + If ($result.success) |
| 11 | + $answer:=$result.data |
| 12 | + End if |
| 13 | +End if |
| 14 | + |
| 15 | + |
| 16 | +If (False:C215) |
| 17 | + $source:="/" |
| 18 | + $result:=$ftp.getDirectoryListing($source) |
| 19 | + If ($result.success) |
| 20 | + $answer:=$result.data |
| 21 | + End if |
| 22 | +End if |
| 23 | + |
| 24 | +If (False:C215) |
| 25 | + $ftp.useCallback(Formula:C1597(ProgressCallback); "ProgressCallback") |
| 26 | + $source:=System folder:C487(Desktop:K41:16)+"Heap.pdf" |
| 27 | + $source:=Convert path system to POSIX:C1106($source) |
| 28 | + $target:="/Firma/test2.pdf" |
| 29 | + $result:=$ftp.upload($source; $target) |
| 30 | + If ($result.success) |
| 31 | + $answer:=$result.data |
| 32 | + End if |
| 33 | +End if |
| 34 | + |
| 35 | +If (False:C215) |
| 36 | + $ftp.useCallback(Formula:C1597(ProgressCallback); "ProgressCallback") |
| 37 | + $target:=System folder:C487(Desktop:K41:16)+"result.pdf" |
| 38 | + $target:=Convert path system to POSIX:C1106($target) |
| 39 | + $source:="/Firma/test2.pdf" |
| 40 | + $result:=$ftp.download($source; $target) |
| 41 | + If ($result.success) |
| 42 | + $answer:=$result.data |
| 43 | + End if |
| 44 | +End if |
| 45 | + |
| 46 | + |
| 47 | +If (True:C214) |
| 48 | + $ftp.useCallback(Formula:C1597(ProgressCallback); "Download 4D.dmg") |
| 49 | + $ftp.setAsyncMode(True:C214) |
| 50 | + |
| 51 | + $source:=System folder:C487(Desktop:K41:16)+"Heap.pdf" |
| 52 | + $source:=Convert path system to POSIX:C1106($source) |
| 53 | + $target:="/Firma/test2.pdf" |
| 54 | + $result:=$ftp.upload($source; $target) |
| 55 | + |
| 56 | + // async, so we need to loop... |
| 57 | + // normally we are supposed to do something else and either |
| 58 | + // check from time to time or to use the callback method to inform us (percent=100) |
| 59 | + Repeat |
| 60 | + $ftp.wait(1) // needed while our process is running |
| 61 | + // wait is not needed if a form would be open or if a worker would handle the job |
| 62 | + $status:=$ftp.status() |
| 63 | + |
| 64 | + Until (Bool:C1537($status.terminated)) |
| 65 | + |
| 66 | +End if |
| 67 | + |
| 68 | +If (False:C215) |
| 69 | + $target:="/Firma/newdir" |
| 70 | + $result:=$ftp.createDirectory($target) |
| 71 | + If ($result.success) |
| 72 | + $answer:=$result.data |
| 73 | + End if |
| 74 | +End if |
| 75 | + |
| 76 | +If (False:C215) |
| 77 | + $target:="/Firma/newdir" |
| 78 | + $result:=$ftp.deleteDirectory($target; True:C214) // delete even with content |
| 79 | + If ($result.success) |
| 80 | + $answer:=$result.data |
| 81 | + End if |
| 82 | +End if |
| 83 | + |
| 84 | +If (False:C215) |
| 85 | + $target:="/Firma/test2.pdf" |
| 86 | + $result:=$ftp.deleteFile($target) |
| 87 | + If ($result.success) |
| 88 | + $answer:=$result.data |
| 89 | + End if |
| 90 | +End if |
0 commit comments