Differences

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

2004-12-17 2004-12-17
no summary (martin) no summary (martin)
Line 16: Line 16:
===== Technical Background ===== ===== Technical Background =====
-Update: Since version 2.2, temporary directory can be changed directly in WinSCP in Preferences.·+This chapter is for those who curious why WinSCP needs shell extension to allow directl downloads using drag&drop.
-Update 2: Since many pople ask, why are the files downloaded first to temporary directory at all, here is short explanation: Windows drag&drop mechanics does not allow source application of drag&drop operation to find out easily, where the files are dropped. It is up to target application (Windows Explorer usually) to transfer files to destination. It is rather reasonable, because source application can hardly transfer files to all possible destinations. Keep in mind that you can drop files not only to a directory, but even to ZIP file (or any other archive), remote directory (via FTP, SCP, SFTP...), trash, ... +Here is short explanation: Windows drag&drop mechanics does not allow source application of drag&drop operation to find out easily, where the files are dropped. It is up to target application (Windows Explorer usually) to transfer files to destination. It is rather reasonable, because source application can hardly transfer files to all possible destinations. Keep in mind that you can drop files not only to a directory, but even to ZIP file (or any other archive), remote directory (via FTP, SCP, SFTP...), trash, ...
-Obviously even Windows Explorer (or any other target application, like WinZip) cannot download files from any possible source (particulary it does not know SCP/SFTP). So the trick is that WinSCP tells Explorer that the files are in temporary folder (from where Explorer knows how to get the files) and a moment before the Explorer starts to copy files from there, WinSCP downloads the files there. +Obviously even Windows Explorer (or any other target application, like WinZip) cannot download files from any possible source (particulary it does not know SCP/SFTP).
-There is a method how to allow direct downloads using drag&drop, at least to normal folders (not FTP, etc.). The method will be eventually implemented in WinSCP. The drawback is that it requires Explorer extension (DLL) to be installed to Windows, which requires you to have administrator priviledges to install WinSCP. It also make WinSCP lose its great advantage, that it is standalone application (EXE file) not requiring any installation at all.  +When the extension is not installed, WinSCP uses trick to allow drag&drop downloads. It tells Explorer that the files are in temporary folder (from where Explorer knows how to get the files) and a moment before the Explorer starts to copy files from there, WinSCP downloads the files there.
- +
-Update 3: the method mentioned above was implemented in 3.5.5 as "drag&drop shell extension".  +
 +To allow direct drag&drop downloads, the shell extension was developed. It misuses Windows Explorer CopyHook's. CopyHook is COM object (DLL library) that is called by Windows Explorer whenever directory (not file) is transfered within file system. When you drag anything from WinSCP, it creates empty dummy folder in temporary directory and pretends that you as user drag that directory. Once your drop it to Windows Explorer, it calls the CopyHook's (including the WinSCP shell extension), telling it what and where was dragged. This way WinSCP knows the actual destination. It cancels the drag&drop operation, so the dummy directory is not copied by Explorer and transfers your actuall selection to now-known destination.

Last modified: by martin