Differences
This shows you the differences between the selected revisions of the page.
2016-06-07 | 2016-07-29 | ||
sessionlogfile alias (martin) | 5.9 stable released (martin) | ||
Line 1: | Line 1: | ||
====== Pack files to ZIP archive and upload it ====== | ====== Pack files to ZIP archive and upload it ====== | ||
- | The following example uses [[library|WinSCP .NET assembly]] from a [[library_powershell|PowerShell]] script. If you have another preferred language, you can easily translate it. The script requires the latest beta version of WinSCP. &beta | + | The following script uses [[library|WinSCP .NET assembly]] from a [[library_powershell|PowerShell]] script. If you have another preferred language, you can easily translate it. The script requires the latest beta version of WinSCP. &beta |
- | //In the latest beta version//, the example is distributed in WinSCP installer as a [[extension|WinSCP extension]]. &beta | + | The script is distributed in WinSCP installer as a [[extension|WinSCP extension]]. &beta |
- | You can run the script (e.g. ''ZipUpload.ps1'') from WinSCP GUI using a [[guide_custom_commands_automation|local custom command]]: | + | To use a different archive format than ZIP, you can install [[http://www.7-zip.org/|7-Zip]], add [[#options|configure the extension]] to use it. |
+ | |||
+ | To run the script manually use: | ||
<code> | <code> | ||
- | powershell.exe -File "ZipUpload.ps1" -sessionUrl "!S" -remotePath "!/" -archiveName "!?&Archive name:?archive.zip!" -pause !& | + | powershell.exe -File "ZipUpload.ps1" -remotePath "/remote/path" -archiveName "archive.zip" file1.dat file2.dat |
</code> | </code> | ||
- | |||
- | You will probably want to enable the //[[ui_customcommand|Apply to directories]]// option. | ||
- | |||
- | To use a different archive format than ZIP, you can install [[http://www.7-zip.org/|7-Zip]], add ''-use7Zip'' switch to the custom command; and add the ''-t<type>'' switch to the ''7z.exe'' call in the script (e.g. ''-tgzip''). | ||
<code powershell - ZipUpload.ps1> | <code powershell - ZipUpload.ps1> |