Differences

This shows you the differences between the selected revisions of the page.

2023-01-10 2023-01-10
no summary (91.66.185.8) (hidden) (untrusted) Restored revision 1600168621. Undoing revision 1673343193. (martin) (hidden)
Line 1: Line 1:
-<!DOCTYPE html> +====== Uploading Files ====== 
-<html> +//This article contains detailed description of uploading files. You may want to see [[guide_upload|simplified guide]] to the process instead.//
-  <head> +
-    <style> +
-      /* Styling für das Spielfeld */ +
-      #game { +
-        width: 400px; +
-        height: 400px; +
-        border: 1px solid black; +
-        position: relative; +
-        background-image: url("landscape.png"); +
-        background-size: cover; +
-      } +
-      /* Styling für den Spieler */ +
-      #player { +
-        width: 50px; +
-        height: 50px; +
-        background-color: blue; +
-        position: absolute; +
-        bottom: 0; +
-        left: 175px; +
-      } +
-      /* Styling für die Plattformen */ +
-      .platform { +
-        width: 100px; +
-        height: 20px; +
-        background-color: transparent; +
-        position: absolute; +
-      } +
-    </style> +
-  </head> +
-  <body> +
-    <!-- Das Spielfeld --> +
-    <div id="game"> +
-      <!-- Der Spieler --> +
-      <div id="player"></div> +
-      <!-- Die Plattformen --> +
-      <div class="platform" style="top: 60px; left: 0;"></div> +
-      <div class="platform" style="top: 140px; left: 300px;"></div> +
-      <div class="platform" style="top: 220px; left: 150px;"></div> +
-    </div> +
-    <script> +
-      // Der Spieler +
-      var player = document.getElementById("player"); +
-      // Die Plattformen +
-      var platforms = document.getElementsByClassName("platform"); +
-······// Die Fallgeschwindigkeit des Spielers +
-     var playerVelocity = 0; +
-     // Die Schwerkraft +
-      var gravity = 0.3; +
-      // Flag, ob sich der Spieler auf einer Plattform befindet +
-······var isOnPlatform = false; +
- ·····// Horizontale Geschwindigkeit des Spielers +
-      var playerHorizontalVelocity = 0; +
-······// Horizontale Bewegungsgeschwindigkeit des Spielers +
-      var playerMovementSpeed = 0.5;+
-      // Spielfunktion, die immer wieder aufgerufen wird +The simplest way to upload files is to drag them from local panel or Windows File Explorer to [[ui_file_panel|remote panel]] of WinSCP. See section [[#dragdrop|Using Drag&amp;drop (Mouse)]].
-     function gameLoop() +
-       // Schwerkraft anwenden +
-       playerVelocity += gravity; +
-       player.style.top = player.offsetTop + playerVelocity + &quot;px"; +
- ·······// Horizontale Bewegung des Spielers +
- ·······player.style.left = player.offsetLeft + playerHorizontalVelocity + &quot;px&quot;;+
-        // Prüfen, ob der Spieler eine Plattform berührt +For alternative ways, advanced options and automation see further sections.
-       for (var i = 0; i < platforms.length; i++) { +
-                    var platform = platforms[i]; +
-          if ( +
-            player.offsetLeft < platform.offsetLeft + platform.offsetWidth && +
-            player.offsetLeft + player.offsetWidth > platform.offsetLeft && +
-            player.offsetTop + player.offsetHeight > platform.offsetTop && +
-            player.offsetTop < platform.offsetTop + platform.offsetHeight +
-          ) { +
-            // Spieler berührt Plattform von unten +
-            if (player.offsetTop + player.offsetHeight < platform.offsetTop + platform.offsetHeight) { +
-              player.style.top = platform.offsetTop - player.offsetHeight + "px"; +
-              playerVelocity = 0; +
-              isOnPlatform = true; +
-            } +
-          } +
-        }+
-········// Prüfen, ob der Spieler das Spielfeld verlässt +===== [[dragdrop]] Using Drag&amp;drop (Mouse) ===== 
- ·······if (player.offsetTop &gt; game.offsetHeight) { +First [[ui_file_panel#selecting_files|select the local files or directories]] you want to upload. You can select the files in the Windows File Explorer or other application. If you are using [[ui_commander|Commander interface]], you can also select the files in its [[ui_file_panel|local panel]].
-··········// Spieler ist unten aus dem Spielfeld gefallen +
-          player.style.top = &quot;0px&quot;; +
-         playerVelocity = 0; +
-       } else if (player.offsetLeft < 0) +
-         // Spieler ist links aus dem Spielfeld gefallen +
-         player.style.left = "0px"; +
-       } else if (player.offsetLeft + player.offsetWidth &gt; game.offsetWidth) +
-         // Spieler ist rechts aus dem Spielfeld gefallen +
-··········player.style.left = game.offsetWidth - player.offsetWidth + "px"; +
-        } +
-      }+
-······// Sprungfunktion +Then drag your selection and drop it on the [[ui_file_panel|remote panel]]. If you drop the files on empty place on file list, the files will be uploaded to current remote directory.((In [[ui_commander|Commander interface]] you may consider turning off //[[ui_pref_commander#panels|Full row select]]// option to be able to drop files everywhere except directory files names to upload them to current remote directory.)) If you drop the files on remote directory icon (either in the file list or directory tree), the files will be uploaded to that directory.
-······function jump() { +
- ·······if (isOnPlatform) { +
- ·········playerVelocity = -10; +
- ·········isOnPlatform = false; +
- ·······} +
- ·····}+
-······// Spielfunktion immer wieder aufrufen +&amp;screenshotpict(upload_dragdrop)
-      setInterval(gameLoop, 1000 / 60);+
-······// Maus- und Touch-Eingaben abfangen +Before the upload actually starts, the [[ui_copy|transfer options dialog]] will show. There you will have a chance to change the transfer options or the target directory. You can avoid the dialog being shown in [[ui_pref_environment#confirmations|preferences]]. In such case you can change the transfer options by selecting preset on //[[ui_toolbars#transfer|Transfer Settings toolbar]]//. 
- ···········document.addEventListener(&quot;mousedown&quot;, jump); + 
-······document.addEventListener(&quot;touchstart&quot;, function(event) { +If you hold ''Shift'' key while dragging the files, they will be moved to remote directory (i.e. transferred and deleted from local directory).  
- ·······event.preventDefault(); + 
- ·······jump(); +You can also [[#drop_tab|drop files to session tab]] to upload them using non-active session. 
- ·····}, { passive: false }); + 
-······document.addEventListener(&quot;mousemove&quot;, function(event) { +===== Using Keyboard ===== 
- ·······// Mausposition abfangen +If you prefer controlling application using keyboard, you will probably find [[ui_commander|Commander interface]] useful. Otherwise, you must use [[#copy_paste|copy&;paste]] method. 
- ·······var mouseX = event.clientX; + 
- ·······// Horizontale Bewegung des Spielers in Abhängigkeit von der Mausposition +First select the local files or directories you want to upload (learn how to [[ui_commander#selecting_files|select files using keyboard]]). Make sure that [[ui_file_panel|local panel]] is still active and use command //Files > Upload// or press ''F5'' key. 
-       if (mouseX &lt; player.offsetLeft) { + 
-         playerHorizontalVelocity = -playerMovementSpeed; +Before the upload actually starts, the [[ui_copy|transfer options dialog]] will show. There you will have a chance to change the transfer options or the target directory. The target directory is by default the current remote directory. You can avoid the dialog being shown in [[ui_pref_environment#confirmations|preferences]]. In such case you can change the transfer options by selecting preset on //[[ui_toolbars#transfer|Transfer Settings toolbar]]//. 
- ·······} else if (mouseX > player.offsetLeft + player.offsetWidth) { + 
- ·········playerHorizontalVelocity = playerMovementSpeed; +If you use //Files &gt; Upload &gt; Upload and Delete// (or press ''F6'' key), the files will be moved to remote directory (i.e. transferred and deleted from local directory). 
- ·······} else { + 
- ·········playerHorizontalVelocity = 0+===== [[copy_paste]] Using Copy&amp;paste ===== 
- ·······} +If you prefer the [[ui_explorer|Explorer interface]], but still want to control it using keyboard, you need to use [[clipboard|copy&amp;paste method]]. 
-······}); + 
-······document.addEventListener(&quot;touchmove&quot;, function(event) { +First select the files you want to upload in Windows File Explorer or other application and copy them to clipboard. 
- ·······// Touchposition abfangen + 
- ·······var touchX = event.touches[0].clientX+Then switch to WinSCP and use command //File(s) > Paste// (or ''Ctrl+V'').  
- ·······// Horizontale Bewegung des Spielers in Abhängigkeit von der Touchposition + 
-       if (touchX &lt; player.offsetLeft) { +Before the upload actually starts, the [[ui_copy|transfer options dialog]] will show. There you will have a chance to change the transfer options or the target directory. The target directory is by default the current remote directory. You can disable the dialog in [[ui_pref_environment|preferences]]. 
-··········playerHorizontalVelocity = -playerMovementSpeed; + 
-········} else if (touchX > player.offsetLeft + player.offsetWidth) { +===== Using Windows File Explorer's 'Send To' Context Menu ===== 
- ·········playerHorizontalVelocity = playerMovementSpeed; + 
- ·······} else { +Learn how to [[integration#send_to|integrate WinSCP into Windows File Explorer's 'Send To' menu]]. 
- ·········playerHorizontalVelocity = 0; + 
- ·······} +===== Dropping Files on WinSCP Icon ===== 
- ·····}); + 
- ·····document.addEventListener(&quot;mouseup&quot;, function(event) { +Files dropped on [[integration#icons|WinSCP icon]] associated with [[session_configuration#site|site]] will be uploaded. 
- ·······// Mausklick losgelassen + 
- ·······playerHorizontalVelocity = 0; +===== [[drop_tab]] Dropping Files on Session Tab ===== 
- ·····}); + 
- ·····document.addEventListener(&quot;touchend&quot;, function(event) { +To upload files using different session than active one, you can drop the local files to any [[ui_sessiontabs|session tab]]. 
-········// Touch losgelassen + 
-········playerHorizontalVelocity = 0; +===== File Upload on Background ===== 
- ·····}); +By default, the file upload starts on foreground, blocking the WinSCP window until it is complete. Learn how to schedule the [[transfer_queue|background transfer]]. 
-····&lt;/script&gt; + 
-  &lt;/body&gt; +===== Preserving Overwritten Remote Files ===== 
-&lt;/html&gt;+You can set up [[ui_login_recycle_bin|remote recycle bin]] to backup files that you overwrite during upload. 
 + 
 +===== Automating Upload ===== 
 +To automate file upload use scripting command ''[[scriptcommand_put|put]]'' or .NET assembly method ''[[library_session_putfiles|Session.PutFiles]]''.

Last modified: by martin